nixpkgs/pkgs/development/libraries/dxflib/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

48 lines
1.3 KiB
Nix
Raw Normal View History

2022-11-03 23:26:43 +00:00
{ lib
, stdenv
, fetchurl
2020-09-07 16:20:28 +00:00
, qmake
}:
stdenv.mkDerivation rec {
version = "3.26.4";
pname = "dxflib";
src = fetchurl {
url = "https://qcad.org/archives/dxflib/${pname}-${version}-src.tar.gz";
sha256 = "0pwic33mj6bp4axai5jiyn4xqf31y0xmb1i0pcf55b2h9fav8zah";
};
nativeBuildInputs = [
2020-09-07 16:20:28 +00:00
qmake
];
dontWrapQtApps = true;
preConfigure = ''
sed -i 's/CONFIG += staticlib/CONFIG += shared/' dxflib.pro
'';
installPhase = ''
install -d -m 0755 $out/lib
2022-11-03 23:26:43 +00:00
cp -pr *${stdenv.hostPlatform.extensions.sharedLibrary}* $out/lib
install -d -m 0755 $out/include/dxflib
cp -pr src/*.h $out/include/dxflib
# Generate pkg-config file
install -d -m 0755 $out/lib/pkgconfig
cat << 'EOF' > $out/lib/pkgconfig/dxflib.pc
prefix=${placeholder "out"}
libdir=${placeholder "out"}/lib
includedir=${placeholder "out"}/include
Name: dxflib
Description: A C++ library for reading and writing DXF files
Version: %{version}
Libs: -L${placeholder "out"}/lib -ldxflib
Cflags: -I${placeholder "out"}/include/dxflib
EOF
'';
doCheck = true;
meta = {
homepage = "https://qcad.org/en/90-dxflib";
2022-11-03 23:26:43 +00:00
maintainers = with lib.maintainers; [ raskin ];
platforms = lib.platforms.unix;
description = "DXF file format library";
};
}