Skip to content

Commit

Permalink
Merge pull request #321966 from nh2/libe57format-3.1.1
Browse files Browse the repository at this point in the history
libe57format: 2.2.0 -> 3.1.1
  • Loading branch information
nh2 authored Jun 23, 2024
2 parents befdad1 + dbbaf02 commit 65378f6
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 21 deletions.
2 changes: 2 additions & 0 deletions nixos/doc/manual/release-notes/rl-2411.section.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@
for `stateVersion` ≥ 24.11. (It was previously using SQLite for structured
data and the filesystem for blobs).

- `libe57format` has been updated to `>= 3.0.0`, which contains some backward-incompatible API changes. See the [release note](https://github.com/asmaloney/libE57Format/releases/tag/v3.0.0) for more details.

- `zx` was updated to v8, which introduces several breaking changes.
See the [v8 changelog](https://github.com/google/zx/releases/tag/8.0.0) for more information.

Expand Down
59 changes: 38 additions & 21 deletions pkgs/development/libraries/libe57format/default.nix
Original file line number Diff line number Diff line change
@@ -1,51 +1,68 @@
{
lib, stdenv,
cmake,
fetchpatch,
fetchFromGitHub,
boost,
fetchpatch,
xercesc,
icu,
}:

stdenv.mkDerivation rec {
stdenv.mkDerivation (finalAttrs: {
pname = "libe57format";
version = "2.2.0";
version = "3.1.1";

src = fetchFromGitHub {
owner = "asmaloney";
repo = "libE57Format";
rev = "v${version}";
sha256 = "15l23spjvak5h3n7aj3ggy0c3cwcg8mvnc9jlbd9yc2ra43bx7bp";
rev = "v${finalAttrs.version}";
hash = "sha256-bOuWh9Nkxva2v0M6+vnAya8EW/G3WQePxHakQt8T9NE=";
fetchSubmodules = true; # for submodule-vendored libraries such as `gtest`
};

# Repository of E57 files used for testing.
libE57Format-test-data_src = fetchFromGitHub {
owner = "asmaloney";
repo = "libE57Format-test-data";
rev = "4960564a732c6444c50dfae5b2273e68837399cd";
hash = "sha256-k26yVbYSQJ3EMgcpjm35N1OAxarFmfMvzfTN2Hdyu8c=";
};

patches = [
# gcc11 header fix
(fetchpatch {
url = "https://github.com/asmaloney/libE57Format/commit/13f6a16394ce3eb50ea4cd21f31f77f53294e8d0.patch";
sha256 = "sha256-4vVhKrCxnWO106DSAk+xxo4uk6zC89m9VQAPaDJ8Ed4=";
})
];
CXXFLAGS = [
# GCC 13: error: 'int16_t' has not been declared in 'std'
"-include cstdint"
];

patches = [
# TODO: Remove with the next release: https://github.com/asmaloney/libE57Format/pull/299
(fetchpatch {
name = "libE57Format-Dont-force-warnings-as-errors-when-building-self.patch"; # https://github.com/apache/thrift/pull/2726
url = "https://github.com/asmaloney/libE57Format/commit/66bb5af15937b4c10a7f412ca4d1673f42bbad28.patch";
hash = "sha256-2cNURjMLP0TijYY5gbuWLE7H/PlMW936wAeOqJ/w9C0=";
})

];

nativeBuildInputs = [
cmake
];

buildInputs = [
boost
icu
xercesc
];

propagatedBuildInputs = [
# Necessary for projects that try to find libE57Format via CMake
# due to the way that libe57format's CMake config is written.
xercesc
cmakeFlags = [
# See https://github.com/asmaloney/libE57Format/blob/9372bdea8db2cc0c032a08f6d655a53833d484b8/test/README.md
(if finalAttrs.doCheck
then "-DE57_TEST_DATA_PATH=${finalAttrs.libE57Format-test-data_src}"
else "-DE57_BUILD_TEST=OFF"
)
];

doCheck = true;

postCheck = ''
./testE57
'';

# The build system by default builds ONLY static libraries, and with
# `-DE57_BUILD_SHARED=ON` builds ONLY shared libraries, see:
# https://github.com/asmaloney/libE57Format/issues/48
Expand All @@ -70,4 +87,4 @@ stdenv.mkDerivation rec {
maintainers = with maintainers; [ chpatrick nh2 ];
platforms = platforms.linux; # because of the .so buiding in `postInstall` above
};
}
})

0 comments on commit 65378f6

Please sign in to comment.