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

libroxml: init at 2.3.0 and osm2xmap: init at 2.0 c1f7b68 #30068

Merged
merged 4 commits into from Feb 3, 2018

Conversation

mpickering
Copy link
Contributor

Motivation for this change

A package which I packaged for my own personal use which wasn't already included.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • [X ] NixOS
    • macOS
    • Linux
  • 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"
  • [X ] Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.


name = "osm2xmap-2.0";

src = fetchurl {
Copy link
Member

Choose a reason for hiding this comment

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

Why not use fetchFromGitHub?

'';

preBuild = ''
'';
Copy link
Member

Choose a reason for hiding this comment

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

I might be wrong but I don't think this overrides it, you might need to pass : to do that, see #29583.

homepage = "https://github.com/sembruk/osm2xmap";
description = "Converter from OpenStreetMap data format to OpenOrienteering Mapper format.";
license = stdenv.lib.licenses.gpl3;
maintainers = [ ];
Copy link
Member

Choose a reason for hiding this comment

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

A maintainer must be set.

buildInputs = [ libroxml proj libyamlcpp boost ];


meta = {
Copy link
Member

Choose a reason for hiding this comment

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

For libroxml you have meta = with stdenv.lib;, so you can also do that here for consistency if you like.

stdenv.mkDerivation {
name = "libroxml-2.3.0";
src = fetchurl {
url = "http://download.libroxml.net/pool/v2.x/libroxml-2.3.0.tar.gz";
Copy link
Member

Choose a reason for hiding this comment

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

For the last part of the URL you can just do ${name}.tar.gz if you'd like (for example to have slightly less things to change if you ever update it). You will need to do stdenv.mkDerivation rec { for that though.

description = "This library is minimum, easy-to-use, C implementation for xml file parsing.";
license = licenses.lgpl3;
platforms = platforms.unix;
maintainers = with maintainers; [ ];
Copy link
Member

Choose a reason for hiding this comment

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

Again, maintainers must be set.

@mpickering
Copy link
Contributor Author

Thanks @vyp I updated the patch taking into account most of your comments. I couldn't get the thing with ${name} to work.

"SHAREDIR=$(out)/share"
"INSTALL_BINDIR=$(out)/bin"
"INSTALL_BINDIR=$(out)/share/man/man1"
"INSTALL_SHAREDIR=$(out)/share"
Copy link
Member

Choose a reason for hiding this comment

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

I cleaned things up a bit here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This broke the build. osm2xmap is not available anymore after these changes.

Copy link
Member

Choose a reason for hiding this comment

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

Typo: I wrote INSTALL_BINDIR=$(out)/share/man/man1 instead of INSTALL_MANDIR=$(out)/share/man/man1

url = "https://github.com/jbeder/yaml-cpp/archive/release-0.3.0.tar.gz";
sha256 = "12aszqw6svwlnb6nzhsbqhz3c7vnd5ahd0k6xlj05w8lm83hx3db";
};
});
Copy link
Member

Choose a reason for hiding this comment

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

I would rather add a dedicated libyamlcpp_0_3 instead so everybody can use it.

@mpickering
Copy link
Contributor Author

Thanks for your help trying to clean things up @Mic92 but it broke the derivation.

@vyp
Copy link
Member

vyp commented Oct 17, 2017

@mpickering So all I just meant was stdenv.mkDerivation rec { for line 3, and url = "http://download.libroxml.net/pool/v2.x/${name}.tar.gz"; for line 6 for libroxml. But no worries it's no big deal to keep it as is either. 👍

@mpickering
Copy link
Contributor Author

It is still broken.. Can you please revert your changes so this can be merged?

@Mic92
Copy link
Member

Mic92 commented Oct 18, 2017

@mpickering are you sure? The build output is identical.

makeFlags = [
"GIT_VERSION=$(version)"
"GIT_TIMESTAMP="
"SHAREDIR=$(out)/share"
Copy link
Member

@Mic92 Mic92 Oct 18, 2017

Choose a reason for hiding this comment

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

This must be:

diff --git a/pkgs/applications/misc/osm2xmap/default.nix b/pkgs/applications/misc/osm2xmap/default.nix
index b827cca6e4c..b5b8e68e077 100644
--- a/pkgs/applications/misc/osm2xmap/default.nix
+++ b/pkgs/applications/misc/osm2xmap/default.nix
@@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
   makeFlags = [
     "GIT_VERSION=$(version)"
     "GIT_TIMESTAMP="
-    "SHAREDIR=$(out)/share"
+    "SHAREDIR=$(out)/share/"
     "INSTALL_BINDIR=$(out)/bin"
     "INSTALL_MANDIR=$(out)/share/man/man1"
     "INSTALL_SHAREDIR=$(out)/share"

@Mic92
Copy link
Member

Mic92 commented Oct 18, 2017

Now only adding libyamlcpp_0_3 is left. And please squash the fixups into osm2xmap: init at 2.0 afterwards.

@mpickering
Copy link
Contributor Author

I made a libyamlcpp_0_3 attribute and squashed your improvements into my patch.

url = "https://github.com/jbeder/yaml-cpp/archive/release-0.3.0.tar.gz";
sha256 = "12aszqw6svwlnb6nzhsbqhz3c7vnd5ahd0k6xlj05w8lm83hx3db";
};
});
Copy link
Member

Choose a reason for hiding this comment

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

indentation


osm2xmap = callPackage ../applications/misc/osm2xmap {
libyamlcpp = libyamlcpp_0_3;

Copy link
Member

@Mic92 Mic92 Oct 18, 2017

Choose a reason for hiding this comment

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

Please remove this empty line.


}


Copy link
Member

@Mic92 Mic92 Oct 18, 2017

Choose a reason for hiding this comment

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

Please remove these empty lines

@mpickering
Copy link
Contributor Author

Removed the whitespace lines now.

@grahamc
Copy link
Member

grahamc commented Feb 3, 2018

@GrahamcOfBorg build osm2xmap lxbroxml

@GrahamcOfBorg
Copy link

Failure on x86_64-linux (full log)

Partial log (click to expand)

error: attribute ‘lxbroxml’ in selection path ‘lxbroxml’ not found

@GrahamcOfBorg
Copy link

Failure on x86_64-darwin (full log)

Partial log (click to expand)

Package ‘osm2xmap-2.0’ in /Users/graham/nix-borg/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/grahamc-ndnd/pkgs/applications/misc/osm2xmap/default.nix:29 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.

@GrahamcOfBorg
Copy link

Failure on aarch64-linux (full log)

Partial log (click to expand)

error: attribute 'lxbroxml' in selection path 'lxbroxml' not found

@grahamc
Copy link
Member

grahamc commented Feb 3, 2018

... d'oh.

@GrahamcOfBorg build osm2xmap libroxml

@GrahamcOfBorg
Copy link

Failure on x86_64-darwin (full log)

Partial log (click to expand)

Package ‘osm2xmap-2.0’ in /Users/graham/nix-borg/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/grahamc-ndnd/pkgs/applications/misc/osm2xmap/default.nix:29 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.

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Partial log (click to expand)

post-installation fixup
shrinking RPATHs of ELF executables and libraries in /nix/store/znzp6rsxfwb0irhjj9byz73npw189zq7-osm2xmap-2.0
shrinking /nix/store/znzp6rsxfwb0irhjj9byz73npw189zq7-osm2xmap-2.0/bin/osm2xmap
gzipping man pages under /nix/store/znzp6rsxfwb0irhjj9byz73npw189zq7-osm2xmap-2.0/share/man/
strip is /nix/store/5qj61lcvzlap87rf6blvf8p577d482bv-binutils-2.28.1/bin/strip
stripping (with command strip and flags -S) in /nix/store/znzp6rsxfwb0irhjj9byz73npw189zq7-osm2xmap-2.0/bin 
patching script interpreter paths in /nix/store/znzp6rsxfwb0irhjj9byz73npw189zq7-osm2xmap-2.0
checking for references to /tmp/nix-build-osm2xmap-2.0.drv-0 in /nix/store/znzp6rsxfwb0irhjj9byz73npw189zq7-osm2xmap-2.0...
/nix/store/znzp6rsxfwb0irhjj9byz73npw189zq7-osm2xmap-2.0
/nix/store/plp5zf1alfh018mvqfzyh8n8dxbkb171-libroxml-2.3.0

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Partial log (click to expand)

post-installation fixup
shrinking RPATHs of ELF executables and libraries in /nix/store/ykkn6dvnm1mz88air1alc7nn25jf3q7q-osm2xmap-2.0
shrinking /nix/store/ykkn6dvnm1mz88air1alc7nn25jf3q7q-osm2xmap-2.0/bin/osm2xmap
gzipping man pages under /nix/store/ykkn6dvnm1mz88air1alc7nn25jf3q7q-osm2xmap-2.0/share/man/
strip is /nix/store/xmpjypwjmp2qi1chs5kr0hacnh161ls4-binutils-2.28.1/bin/strip
stripping (with command strip and flags -S) in /nix/store/ykkn6dvnm1mz88air1alc7nn25jf3q7q-osm2xmap-2.0/bin
patching script interpreter paths in /nix/store/ykkn6dvnm1mz88air1alc7nn25jf3q7q-osm2xmap-2.0
checking for references to /build in /nix/store/ykkn6dvnm1mz88air1alc7nn25jf3q7q-osm2xmap-2.0...
/nix/store/ykkn6dvnm1mz88air1alc7nn25jf3q7q-osm2xmap-2.0
/nix/store/5j6yzrsa88rnj428rk0pd47vv5aa8pfl-libroxml-2.3.0

@grahamc grahamc merged commit 92b786a into NixOS:master Feb 3, 2018
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

5 participants