Skip to content
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

Merged
merged 5 commits into from Jan 11, 2018
Merged

librepcb-unstable: init at 2017-12-29 #33630

merged 5 commits into from Jan 11, 2018

Conversation

Luz
Copy link
Contributor

@Luz Luz commented Jan 8, 2018

Motivation for this change
Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

meta = with stdenv.lib; {
description = "A free EDA software to develop printed circuit boards";
homepage = http://librepcb.org/;
maintainers = with maintainers; [ luz ];
Copy link
Member

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.

Copy link
Member

@andir andir left a 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";
Copy link
Member

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;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


enableParallelBuilding=true;

nativeBuildInputs = [ qmake qttools qtbase ];
Copy link
Member

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";
Copy link
Member

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";
Copy link
Member

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 ];
Copy link
Member

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";
Copy link
Member

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";
Copy link
Member

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 ];
Copy link
Member

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";
Copy link
Member

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

@ubruhin
Copy link

ubruhin commented Jan 9, 2018

Should we provide git to extract the current treeish/tag to be displayed during runtime?

It's not that important, but yes, if it's easy to provide the git command at build time, it would be useful because the revision information is displayed at runtime 👍

@Mic92
Copy link
Member

Mic92 commented Jan 11, 2018

@GrahamcOfBorg build librepcb

Copy link

@GrahamcOfBorg GrahamcOfBorg left a 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.

Copy link

@GrahamcOfBorg GrahamcOfBorg left a 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

Copy link

@GrahamcOfBorg GrahamcOfBorg left a 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

@Mic92 Mic92 merged commit e056315 into NixOS:master Jan 11, 2018
@Luz Luz deleted the librepcb branch January 11, 2018 21:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants