I'm trying to build pyinstaller recipe, I used pipoe here , but I got this error while i Told it to inherit pypi setuptools. Can anyone help please?
THank you .
ERROR: ParseError at /home/yasmine/yocto/poky/meta-pyinst/recipes-pyinstaller/pyinstaller/python-altgraph_0.17.bb:16: Could not inherit file classes/setuptools.bbclass
First, it is good practice to use pipoe to create python recipes automatically.
Check my response here on how to use it.
I used it to create pyinstaller recipe, it detected that pyinstaller depends, in run time RDEPENDS, on:
python3-altgraph
python3-pyinstaller-hooks-contrib
So, here are the recipes:
python3-pyinstaller_4.5.1.bb
SUMMARY = "PyInstaller bundles a Python application and all its dependencies into a single package."
HOMEPAGE = "http://www.pyinstaller.org/"
AUTHOR = "Hartmut Goebel, Giovanni Bajo, David Vierra, David Cortesi, Martin Zibricky <>"
LICENSE = "CLOSED"
SRC_URI = "https://files.pythonhosted.org/packages/a9/d9/9fdfb0ac2354d059e466d562689dbe53a23c4062019da2057f0eaed635e0/pyinstaller-4.5.1.tar.gz"
SRC_URI[md5sum] = "cd1fab890e538ed62ac9121e043632e3"
SRC_URI[sha256sum] = "30733baaf8971902286a0ddf77e5499ac5f7bf8e7c39163e83d4f8c696ef265e"
S = "${WORKDIR}/pyinstaller-4.5.1"
RDEPENDS_${PN} = "python3-setuptools python3-altgraph python3-pyinstaller-hooks-contrib"
DEPENDS += "python3-wheel python3-wheel-native"
inherit setuptools3
python3-pyinstaller-hooks-contrib_2021.2.bb
SUMMARY = "Community maintained hooks for PyInstaller"
HOMEPAGE = "https://github.com/pyinstaller/pyinstaller-hooks-contrib"
AUTHOR = " <>"
LICENSE = "CLOSED"
LIC_FILES_CHKSUM = "file://LICENSE;md5=822bee463f4e00ac4478593130e95ccb"
SRC_URI = "https://files.pythonhosted.org/packages/eb/fa/fe062e44776ab8edb4ac62daca1a02bb744ebdd556ec7a75c19c717e80b4/pyinstaller-hooks-contrib-2021.2.tar.gz"
SRC_URI[md5sum] = "322f5534dd0df2d3fbb8fd55ec7cddbf"
SRC_URI[sha256sum] = "7f5d0689b30da3092149fc536a835a94045ac8c9f0e6dfb23ac171890f5ea8f2"
S = "${WORKDIR}/pyinstaller-hooks-contrib-2021.2"
RDEPENDS_${PN} = ""
inherit setuptools3
python3-altgraph_0.17.bb
SUMMARY = "Python graph (network) package"
HOMEPAGE = "https://altgraph.readthedocs.io"
AUTHOR = "Ronald Oussoren <ronaldoussoren#mac.com>"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://LICENSE;md5=3590eb8d695bdcea3ba57e74adf8a4ed"
SRC_URI = "https://files.pythonhosted.org/packages/22/5a/ac50b52581bbf0d8f6fd50ad77d20faac19a2263b43c60e7f3af8d1ec880/altgraph-0.17.tar.gz"
SRC_URI[md5sum] = "9450020282270749db205038b8c90b55"
SRC_URI[sha256sum] = "1f05a47122542f97028caf78775a095fbe6a2699b5089de8477eb583167d69aa"
S = "${WORKDIR}/altgraph-0.17"
RDEPENDS_${PN} = ""
inherit setuptools3
If you have a custom layer, you can create:
meta-custom/recipes-python/pyinstaller
and put all three recipes inside that.
Now, just add python3-pyinstaller to IMAGE_INSTALL :
IMAGE_INSTALL_append = " python3-pyinstaller"
It could be that your setup only have python3 so you either change the inherit from setuptools to setuptools3, or your tell pipoe to use python3 by typing:
pipoe --python python3 --package pyinstaller
If you then read the generated files you would see that it inherits setuptools3.
Related
I've created a project which has two targets, core.dll and runner.exe.
Core.dll depends on Qt5::Core.
Runner.exe depends on core.dll.
Also I've created a conan recipe conanfile.py.
I defined qt in requirements:
def requirements(self):
self.requires("qt/e5.12.4#mikhail/testing", private=False)
In package_info I use components:
def package_info(self):
self.cpp_info.components["core"].libs = ["core"]
self.cpp_info.components["core"].requires = ["qt"]
self.cpp_info.components["runner"].requires = ["core"]
On build I have error:
File
"C:\Users\user\AppData\Roaming\Python\Python37\site-packages\conans\client\installer.py",
line 571, in _call_package_info
raise ConanException("%s package_info(): %s" % (str(conanfile), e)) conans.errors.ConanException: lexer/1.0.0#mikhail/testing
package_info(): Package require 'qt' not used in components requires
I assume I miss some detail. I would appreciate any advice or reference to read about.
conanfile.py
from conans import ConanFile, CMake, tools
import os.path
class LexerConan(ConanFile):
name = "lexer"
license = "Proprietary"
author = "Mikhail"
topics = ("lexer")
version = "1.0.0"
settings = {
"os": ["Windows"],
"compiler": None,
"build_type": None,
"arch": None
}
options = {"shared": [True, False]}
default_options = {
"shared": False
}
generators = "cmake_paths"
exports_sources = "*"
no_copy_source = True
def build_requirements(self):
self.build_requires("cmake-toolkit/1.0.0#mikhail/stable")
self.build_requires("cmake/3.17.1")
def requirements(self):
self.requires("qt/e5.12.4#mikhail/testing", private=False)
def build(self):
cmake = CMake(self)
cmake.definitions["VERSION"] = self.version
cmake.definitions["CMAKE_TOOLCHAIN_FILE"] = os.path.join(self.build_folder, "conan_paths.cmake")
cmake.configure()
cmake.build()
def package(self):
cmake = CMake(self)
cmake.configure()
cmake.install()
def package_info(self): #ERROR ConanException: Package require 'qt' not used in components requires
self.cpp_info.components["core"].libs = ["core"]
self.cpp_info.components["core"].requires = ["qt"]
self.cpp_info.components["runner"].requires = ["core"]
If you need more details I created a reference project on GitHub
I had to use namespace qt::qt.
self.cpp_info.components["core"].requires = ["qt::qt"]
I am trying to commit my manifest.toml file for a private Julia project that has a private dependancy. In the manifest.toml file, it has a local path to the project for the private dependancy as follows:
[[Private_Package]]
deps = ["AbstractTrees", "D3Trees", "DataStructures", "Distributions", "LinearAlgebra", "POMDPs", "Parameters", "Printf", "Random", "StatsBase"]
path = "/Users/logankilpatrick/.julia/dev/Private_Package"
uuid = "rand-rand-rand"
version = "0.X.0"
How can I keep this in my manifest file but make sure it's not a local path so I can commit to the repo?
I ended up going with Pkg.add() per #kevbonham suggestion. It did the trick:
[[Private_Package]]
deps = ["AbstractTrees", "D3Trees", "DataStructures", "Distributions", "LinearAlgebra", "POMDPs", "Parameters", "Printf", "Random", "StatsBase"]
git-tree-sha1 = "x_x_x"
repo-rev = "master"
repo-url = "https://github.com/Private_Package/Private_Package.git"
uuid = "rand-rand-rand-rand-rand"
version = "0.2.0"
Thank you both #DavidVarela
This question has been posted before in the qt community: https://forum.qt.io/topic/106930/how-to-run-lupdate-with-a-qmake-config
I use such a construct in my project files:
LANGUAGES = de
TRANSLATION_NAME = authorization
include(../../gen_translations.pri)
where gen_translations.pri looks like so:
# parameters: var, prepend, append
defineReplace(prependAll) {
for(a,$$1):result += $$2$${a}$$3
return($$result)
}
TRANSLATIONS = $$prependAll(LANGUAGES, $$PWD/libs/$$TRANSLATION_NAME/translations/lib$${TRANSLATION_NAME}_, .ts)
TRANSLATIONS_FILES =
qtPrepareTool(LRELEASE, lrelease)
for(tsfile, TRANSLATIONS) {
qmfile = $$shadowed($$tsfile)
qmfile ~= s,.ts$,.qm,
qmdir = $$dirname(qmfile)
!exists($$qmdir) {
mkpath($$qmdir)|error("Aborting.")
}
command = $$LRELEASE -removeidentical $$tsfile -qm $$qmfile
system($$command)|error("Failed to run: $$command")
TRANSLATIONS_FILES += $$qmfile
}
for(qmentry, $$list($$TRANSLATIONS_FILES)) {
qmpath = $$OUT_PWD/../translations
qmpathname = $$replace(qmpath,/,)
qmpathname = $$replace(qmpathname,\.,)
qmpathname = $$replace(qmpathname,:,)
qmpathname = $$replace(qmpathname," ",)
qmentity = qmfiles_$${qmpathname}
eval($${qmentity}.files += $$qmentry)
eval($${qmentity}.path = $$qmpath)
INSTALLS *= $${qmentity}
}
It generates the *.qm files for me and moves them to a defined location with make install.
I do not want qmake to execute that whole stuff for each build on my developing machine. Therefore I want to make it conditional by wrapping it for qmake:
translate{
LANGUAGES = de
TRANSLATION_NAME = authorization
include(../../gen_translations.pri)
}
That way I can decide when I want to get *.qm files and when not.
But then I am unable to run lupdate on the project file beforehand because it is blocked by that conditional.
I am sure, that someone has a better idea to accomplish the task.
Thanks in advance.
I'm sharing here my recipe for the vmpk project. I've borrowed it from the Arora project (I think). It is much simpler than yours, and I let qmake to decide if it is necessary regenerate any .qm files when the output has been erased or the input .ts has changed, like any other compiler does.
updateqm.pri
# update translations
isEmpty(QMAKE_LRELEASE) {
win32:QMAKE_LRELEASE = $$[QT_INSTALL_BINS]\\lrelease.exe
else:QMAKE_LRELEASE = $$[QT_INSTALL_BINS]/lrelease
!exists($$QMAKE_LRELEASE) { QMAKE_LRELEASE = lrelease }
}
updateqm.input = TRANSLATIONS
updateqm.output = $$OUT_PWD/${QMAKE_FILE_BASE}.qm
updateqm.commands = $$QMAKE_LRELEASE ${QMAKE_FILE_IN} -qm $$OUT_PWD/${QMAKE_FILE_BASE}.qm
updateqm.CONFIG += no_link target_predeps
QMAKE_EXTRA_COMPILERS += updateqm
project.pro:
TRANSLATIONS += \
translations/project_en.ts \
translations/project_cs.ts \
translations/project_de.ts \
translations/project_es.ts \
translations/project_fr.ts \
translations/project_ru.ts
include(updateqm.pri)
With this project file you can do, as always:
lupdate project.pro
Anyway, Qt5 has a builtin CONFIG+=lrelease option that makes "updateqm.pri" deprecated.
Two related questions:
1. How does one install R and selected packages in the configuration.nix?
2. How does one add packages not only from CRAN but also from Gitub or at least locally stored?
In the wiki you will find instructions like these to install R packages. https://github.com/NixOS/nixpkgs/blob/master/doc/languages-frameworks/r.section.md . Have it working when using nix-shell but I'm stuck while trying to do the installation from configuration.nix.
Regarding building R packages and I have found this example regarding building packages:
let
pkgs = import <nixpkgs> {};
buildRPackage = import <nixpkgs/pkgs/development/r-modules/generic-builder.nix> pkgs.R;
in
with pkgs.rPackages;
{
foobar = buildRPackage {
name = "your-package-name-1.0";
src = ./.;
propagatedBuildInputs = [/* required dependencies go here */];
};
}
The command "nix-build . -A foobar" would then compile it.
But would like to run all from configuration.nix in order to the machine configuration in one place.
Ok, with the help of Bulats pointer above I managed to find a solution. A complete example was found here: https://github.com/NixOS/nixpkgs/issues/44290
For future reference here is one way of adding r packages both from CRAN and Github inline in configuration.nix:
environment.systemPackages = with pkgs;
[(pkgs.rWrapper.override {
packages = with pkgs.rPackages; let
llr = buildRPackage {
name = "llr";
src = pkgs.fetchFromGitHub {
owner = "dirkschumacher";
repo = "llr";
rev = "0a654d469af231e9017e1100f00df47bae212b2c";
sha256 = "0ks96m35z73nf2sb1cb8d7dv8hq8dcmxxhc61dnllrwxqq9m36lr";};
propagatedBuildInputs = [ rlang knitr];
nativeBuildInputs = [ rlang knitr ];};
in [knitr
rlang
llr
tidyverse
## the rest of your R packages here
devtools];})
pkgs.postgresql
pkgs.isync
pkgs.msmtp
pkgs.notmuch
gnupg
## the rest of your Nixos packages (derivations) here
];
I'm new to Autotools and I'm trying to add gtest Unit Tests to a project that is using Autotools.
I have a simple directories structure:
. - main
./src - sources
./tests - tests
./paths - git submodule with paths
In tests directory I have one cpp file per tested class and my Makefile.am looks like so:
AUTOMAKE_OPTIONS = serial-tests
AM_CXXFLAGS = -I$(top_srcdir)/src -I$(top_srcdir)/paths -DUNIT_TEST
AM_LDFLAGS = -pthread
LDADD = -lgtest -lgtest_main
TESTS = test_networkconfig test_dummy ### depending on content of this variable
check_PROGRAMS = $(TESTS)
test_networkconfig_SOURCES = test_networkconfig.cpp ### generate this
test_networkconfig_LDADD = $(top_srcdir)/src/networkconfig.o \
-lgtest \
-lgtest_main
test_networkconfig_CPPFLAGS = $(somelibrary_CFLAGS)
test_dummy_SOURCES = test_dummy.cpp ### and this variable
I would like to automatically generate:
test_networkconfig_SOURCES = test_networkconfig.cpp
test_dummy_SOURCES = test_dummy.cpp
Is there a way to create a variable <some_name>_SOURCES = <some_name>.cpp for each value that is held by TESTS variable?
In Automake you can only do this in a limited way. In particular, for a program P, if P_SOURCES is not defined, then Automake will compute a default using the program name and the value of AM_DEFAULT_SOURCE_EXT (defaults to .c).
So in your case:
AM_DEFAULT_SOURCE_EXT = .cpp
should do the trick.