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

libphonenumber: init at 8.9.9 #43397

Merged
merged 2 commits into from Aug 13, 2018
Merged

Conversation

illegalprime
Copy link
Member

@illegalprime illegalprime commented Jul 12, 2018

Motivation for this change

Adds libphonenumber a handy library to parse and work with phone number of different formats.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option 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/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Fits CONTRIBUTING.md.

This is my first package contribution here, so I'm sorry in advance if I don't have everything formatted.

@FRidh
Copy link
Member

FRidh commented Jul 12, 2018

@FRidh
Copy link
Member

FRidh commented Jul 12, 2018

@GrahamcOfBorg build libphonenumber

@GrahamcOfBorg
Copy link

No attempt on x86_64-linux (full log)

The following builds were skipped because they don't evaluate on x86_64-linux: libphonenumber

Partial log (click to expand)

Cannot nix-instantiate `libphonenumber' because:
error: attribute 'libphonenumber' in selection path 'libphonenumber' not found

@GrahamcOfBorg
Copy link

No attempt on x86_64-darwin (full log)

The following builds were skipped because they don't evaluate on x86_64-darwin: libphonenumber

Partial log (click to expand)

Cannot nix-instantiate `libphonenumber' because:
�[31;1merror:�[0m attribute 'libphonenumber' in selection path 'libphonenumber' not found

@GrahamcOfBorg
Copy link

No attempt on aarch64-linux (full log)

The following builds were skipped because they don't evaluate on aarch64-linux: libphonenumber

Partial log (click to expand)

Cannot nix-instantiate `libphonenumber' because:
error: attribute 'libphonenumber' in selection path 'libphonenumber' not found

@FRidh
Copy link
Member

FRidh commented Jul 12, 2018

@GrahamcOfBorg build phonenumber

@GrahamcOfBorg
Copy link

Failure on x86_64-darwin (full log)

Attempted: phonenumber

Partial log (click to expand)

      ^~~~~~~~~~~~~
/nix/store/qz17zdv0hxangjzb6sbswnxnb6d076dh-icu4c-59.1-dev/include/unicode/unistr.h:3180:7: error: delegating constructors are permitted only in C++11
      UnicodeString(Char16Ptr(buffer), buffLength, buffCapacity) {}
      ^~~~~~~~~~~~~
3 errors generated.
make[2]: *** [CMakeFiles/geocoding.dir/build.make:359: CMakeFiles/geocoding.dir/src/phonenumbers/geocoding/phonenumber_offline_geocoder.cc.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:423: CMakeFiles/geocoding.dir/all] Error 2
make: *** [Makefile:152: all] Error 2
builder for '/nix/store/l0k6dyz3kjwy6xw9658cdccbj432zqi4-phonenumber-8.9.9.drv' failed with exit code 2
�[31;1merror:�[0m build of '/nix/store/l0k6dyz3kjwy6xw9658cdccbj432zqi4-phonenumber-8.9.9.drv' failed

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: phonenumber

Partial log (click to expand)

post-installation fixup
shrinking RPATHs of ELF executables and libraries in /nix/store/yghg2xxgs6qz87wg0b6cgwd8jmdam3v7-phonenumber-8.9.9
shrinking /nix/store/yghg2xxgs6qz87wg0b6cgwd8jmdam3v7-phonenumber-8.9.9/lib64/libphonenumber.so.8.9
shrinking /nix/store/yghg2xxgs6qz87wg0b6cgwd8jmdam3v7-phonenumber-8.9.9/lib64/libgeocoding.so.8.9
strip is /nix/store/4qvrxzxa535y8304mk195x50b6p9607d-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/yghg2xxgs6qz87wg0b6cgwd8jmdam3v7-phonenumber-8.9.9/lib64
patching script interpreter paths in /nix/store/yghg2xxgs6qz87wg0b6cgwd8jmdam3v7-phonenumber-8.9.9
checking for references to /build in /nix/store/yghg2xxgs6qz87wg0b6cgwd8jmdam3v7-phonenumber-8.9.9...
moving /nix/store/yghg2xxgs6qz87wg0b6cgwd8jmdam3v7-phonenumber-8.9.9/lib64/* to /nix/store/yghg2xxgs6qz87wg0b6cgwd8jmdam3v7-phonenumber-8.9.9/lib
/nix/store/yghg2xxgs6qz87wg0b6cgwd8jmdam3v7-phonenumber-8.9.9

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: phonenumber

Partial log (click to expand)

post-installation fixup
shrinking RPATHs of ELF executables and libraries in /nix/store/d14l5lq677lixc3ha8cm3g1r3dvpgqrx-phonenumber-8.9.9
shrinking /nix/store/d14l5lq677lixc3ha8cm3g1r3dvpgqrx-phonenumber-8.9.9/lib64/libgeocoding.so.8.9
shrinking /nix/store/d14l5lq677lixc3ha8cm3g1r3dvpgqrx-phonenumber-8.9.9/lib64/libphonenumber.so.8.9
strip is /nix/store/0pjsgkxz0rp5baycq5sp2s72lrr5q9sg-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/d14l5lq677lixc3ha8cm3g1r3dvpgqrx-phonenumber-8.9.9/lib64
patching script interpreter paths in /nix/store/d14l5lq677lixc3ha8cm3g1r3dvpgqrx-phonenumber-8.9.9
checking for references to /build in /nix/store/d14l5lq677lixc3ha8cm3g1r3dvpgqrx-phonenumber-8.9.9...
moving /nix/store/d14l5lq677lixc3ha8cm3g1r3dvpgqrx-phonenumber-8.9.9/lib64/* to /nix/store/d14l5lq677lixc3ha8cm3g1r3dvpgqrx-phonenumber-8.9.9/lib
/nix/store/d14l5lq677lixc3ha8cm3g1r3dvpgqrx-phonenumber-8.9.9

@illegalprime
Copy link
Member Author

Thanks! Who should I put as the maintainer?

@illegalprime illegalprime changed the title Add libphonenumber package libphonenumber: init at 8.9.9 Jul 12, 2018
@xeji
Copy link
Contributor

xeji commented Jul 12, 2018

If you like you can add yourself to maintainers/maintainer-list.nix and as a maintainer for this package.

license = stdenv.lib.licenses.asl20;
};

configurePhase = "cmake -DCMAKE_INSTALL_PREFIX=$out cpp";
Copy link
Member

Choose a reason for hiding this comment

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

I think you should be able to leave this out & move it to cmakeFlags.

@illegalprime
Copy link
Member Author

@matthewbauer how would I specify that the directory with the CMakeLists.txt is cpp?

@illegalprime illegalprime force-pushed the libphonenumber branch 2 times, most recently from 5b87016 to 1246529 Compare July 14, 2018 18:23
@matthewbauer
Copy link
Member

You should just be able to put it in cmakeFlags I believe. It’s not that important though sice i think what you have is equivalent.

You should mark the package as linux only here though because it looks like there is some issues on macOS.

src = fetchurl {
url = "https://github.com/googlei18n/libphonenumber/archive/v${version}.tar.gz";
sha256 = "1m2z5hk2yg99sqi70wf26biprhppklwxwyk0g717c1x6yybch13g";
};
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.


nativeBuildInputs = [
cmake
];
Copy link
Member

Choose a reason for hiding this comment

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

pkgconfig and gmock should probably be in nativeBuildInputs.

description = "Google's i18n library for parsing and using phone numbers";
license = licenses.asl20;
maintainers = with maintainers; [ illegalprime ];
};
Copy link
Member

Choose a reason for hiding this comment

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

Nitpick: Can you move this meta section to the very bottom? It's somewhat of a convention


checkPhase = "./libphonenumber_test";

doCheck = true;
Copy link
Member

Choose a reason for hiding this comment

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

I think doCheck is true by default if I'm not mistaken.

@@ -4470,6 +4470,8 @@ with pkgs;

phodav = callPackage ../tools/networking/phodav { };

phonenumber = callPackage ../development/libraries/libphonenumber { };
Copy link
Member

Choose a reason for hiding this comment

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

Use libphonenumber instead, and put it in the section of all-packages.nix where other libraries are.

Copy link
Member Author

Choose a reason for hiding this comment

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

I thought this was alphabetical? Never mind my brain messed up

maintainers = with maintainers; [ illegalprime ];
};

configurePhase = "cmake -DCMAKE_INSTALL_PREFIX=$out cpp";
Copy link
Member

Choose a reason for hiding this comment

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

Remove this and use cmakeDir = "../cpp"; instead.

@illegalprime
Copy link
Member Author

Is it better to have version as an argument to this function? Like { version ? "8.9.9" }? Then it would be easy to build different versions, or my understanding of this is just off.

@infinisil
Copy link
Member

Nah, Nix doesn't generally handle versions like that. And overriding it like that wouldn't change anything in fact, because the source will still point to the old version. This PR looks good to me like this, thanks :)

@infinisil
Copy link
Member

Oh wait one more thing: Can you make a first commit for adding you as a maintainer and a second one for adding the package?

@infinisil
Copy link
Member

Ping

@illegalprime
Copy link
Member Author

illegalprime commented Aug 13, 2018 via email

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