-
-
Notifications
You must be signed in to change notification settings - Fork 15.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
librepcb-unstable: init at 2017-12-29 #33630
Conversation
meta = with stdenv.lib; { | ||
description = "A free EDA software to develop printed circuit boards"; | ||
homepage = http://librepcb.org/; | ||
maintainers = with maintainers; [ luz ]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You'll have to add yourself to lib/maintainers.nix
for that to work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for PR!
I've left some comments.
During build I am receiving a few lines like this:
g++ -c -pipe -Wextra -O2 -fPIC -std=gnu++11 -Wall -W -D_REENTRANT -DQUAZIP_STATIC -DAPP_VERSION=\"0.1.0\" -DFIp
/nix/store/nkq0n2m4shlbdvdq0qijib5zyzgmn0vq-bash-4.4-p12/bin/bash: git: command not found
g++ -c -pipe -Wextra -O2 -fPIC -std=gnu++11 -Wall -W -D_REENTRANT -DQUAZIP_STATIC -DAPP_VERSION=\"0.1.0\" -DFIp
Should we provide git to extract the current treeish/tag to be displayed during runtime?
When trying to execute the application I am getting the following error:
This application failed to start because it could not find or load the Qt platform plugin "xcb"
in "".
patches = [ ./fix-2017-12.patch ]; | ||
|
||
#recursive qmake building is required -> therefore this line is required (qmake -r) | ||
preBuild = "mkdir build && cd build && qmake -r ../librepcb.pro PREFIX=$out QMAKE_LRELEASE=${stdenv.lib.getDev qttools.dev}/bin/lrelease"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can probably just do qmakeFlags = [ "-r" ];
instead of your preBuild
line. There are qmke hooks in-place that take care of the PREFIX
and QMAKE_LRELEASE
etc...
sha256 = "0r33fm1djqpy0dzvnf5gv2dfh5nj2acaxb7w4cn8yxdgrazjf7ak"; | ||
}; | ||
|
||
enableParallelBuilding=true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That should be the default for all qmake based projects. See: https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/libraries/qt-5/hooks/qmake-hook.sh#L13
|
||
enableParallelBuilding=true; | ||
|
||
nativeBuildInputs = [ qmake qttools qtbase ]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is qtbase
really a nativeBuildInput? Wouldn't that be a regular buildInput
since it is most likely only used for linking/headers?
name = "librepcb-unstable"; | ||
version = "2017-12-29"; | ||
src = fetchgit { | ||
url = "git://github.com/LibrePCB/LibrePCB"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use fetchfromGitHub
instead
|
||
stdenv.mkDerivation rec { | ||
name = "librepcb-unstable"; | ||
version = "2017-12-29"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
usually -
should not be part of the version. Everything after the last -
denotes the package version.
Also version
is not a (formal?) required attribute. Often it is just used as convenient way to share the version string across multiple place within a package.
You should probably rewrite the beginning of your deriviation to look like this:
stdenv.mkDerivation rec {
version = "0.git.20171229";
name = "librepcb-${version}";
…
}
meta = with stdenv.lib; { | ||
description = "A free EDA software to develop printed circuit boards"; | ||
homepage = http://librepcb.org/; | ||
maintainers = with maintainers; [ luz ]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs to be added to lib/maintainers.nix
as well.
name = "librepcb-unstable"; | ||
version = "2017-12-29"; | ||
src = fetchgit { | ||
url = "git://github.com/LibrePCB/LibrePCB"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using https for cloning is the preferred way. I switched this to fetchFromGitHub
, which does this.
patches = [ ./fix-2017-12.patch ]; | ||
|
||
#recursive qmake building is required -> therefore this line is required (qmake -r) | ||
preBuild = "mkdir build && cd build && qmake -r ../librepcb.pro PREFIX=$out QMAKE_LRELEASE=${stdenv.lib.getDev qttools.dev}/bin/lrelease"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this can be simplified by:
qmakeFlags = ["-r"];
|
||
nativeBuildInputs = [ qmake qttools qtbase ]; | ||
|
||
patches = [ ./fix-2017-12.patch ]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you rename the patch to make it self-explaining (in example what the patch fixes).
{ stdenv, fetchgit, qtbase, qttools, qmake, mesa, openssl, zlib }: | ||
|
||
stdenv.mkDerivation rec { | ||
name = "librepcb-unstable"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the name should contain the version or a date of last commit, if a software project does make releases
It's not that important, but yes, if it's easy to provide the |
@GrahamcOfBorg build librepcb |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Failure for system: x86_64-darwin
Package ‘librepcb-20171229’ in /tmp/nix-ofborg/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/lnl7-mac/pkgs/applications/science/electronics/librepcb/default.nix:27 is not supported on ‘x86_64-darwin’, refusing to evaluate.
a) For `nixos-rebuild` you can set
{ nixpkgs.config.allowBroken = true; }
in configuration.nix to override this.
b) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
{ allowBroken = true; }
to ~/.config/nixpkgs/config.nix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Success for system: aarch64-linux
shrinking /nix/store/75v9x9r4kdqvj74ly3bvxbmxjc5rxd4j-librepcb-20171229/bin/librepcb
strip is /nix/store/c6qj0j45xizkrx58i65j75a5ysmqhgrs-binutils-2.28.1/bin/strip
stripping (with command strip and flags -S) in /nix/store/75v9x9r4kdqvj74ly3bvxbmxjc5rxd4j-librepcb-20171229/bin
patching script interpreter paths in /nix/store/75v9x9r4kdqvj74ly3bvxbmxjc5rxd4j-librepcb-20171229
checking for references to /build in /nix/store/75v9x9r4kdqvj74ly3bvxbmxjc5rxd4j-librepcb-20171229...
postPatchMkspecs
postMoveQtStaticLibs
postPatchMkspecs
postMoveQtStaticLibs
/nix/store/75v9x9r4kdqvj74ly3bvxbmxjc5rxd4j-librepcb-20171229
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Success for system: x86_64-linux
shrinking /nix/store/cgkskzqk1ffmdr0g97y8cnlq73dk9fqc-librepcb-20171229/bin/librepcb
strip is /nix/store/wxn5gn8amxm1w0ikcx4gbs8a17wvss4j-binutils-2.28.1/bin/strip
stripping (with command strip and flags -S) in /nix/store/cgkskzqk1ffmdr0g97y8cnlq73dk9fqc-librepcb-20171229/bin
patching script interpreter paths in /nix/store/cgkskzqk1ffmdr0g97y8cnlq73dk9fqc-librepcb-20171229
checking for references to /tmp/nix-build-librepcb-20171229.drv-0 in /nix/store/cgkskzqk1ffmdr0g97y8cnlq73dk9fqc-librepcb-20171229...
postPatchMkspecs
postMoveQtStaticLibs
postPatchMkspecs
postMoveQtStaticLibs
/nix/store/cgkskzqk1ffmdr0g97y8cnlq73dk9fqc-librepcb-20171229
Motivation for this change
Things done
build-use-sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)