2022-11-03 23:26:43 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
2020-08-03 19:21:14 +00:00
|
|
|
, fetchurl
|
2020-09-07 16:20:28 +00:00
|
|
|
, qmake
|
2020-08-03 19:21:14 +00:00
|
|
|
}:
|
2012-08-27 11:17:02 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2021-10-09 16:05:45 +00:00
|
|
|
version = "3.26.4";
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "dxflib";
|
2012-08-27 11:17:02 +00:00
|
|
|
src = fetchurl {
|
2021-10-09 16:05:45 +00:00
|
|
|
url = "https://qcad.org/archives/dxflib/${pname}-${version}-src.tar.gz";
|
|
|
|
sha256 = "0pwic33mj6bp4axai5jiyn4xqf31y0xmb1i0pcf55b2h9fav8zah";
|
2012-08-27 11:17:02 +00:00
|
|
|
};
|
2020-08-03 19:21:14 +00:00
|
|
|
nativeBuildInputs = [
|
2020-09-07 16:20:28 +00:00
|
|
|
qmake
|
2020-08-03 19:21:14 +00:00
|
|
|
];
|
2021-01-12 11:50:23 +00:00
|
|
|
dontWrapQtApps = true;
|
2020-08-03 19:21:14 +00:00
|
|
|
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
|
2020-08-03 19:21:14 +00:00
|
|
|
install -d -m 0755 $out/include/dxflib
|
|
|
|
cp -pr src/*.h $out/include/dxflib
|
2021-01-19 06:50:56 +00:00
|
|
|
# Generate pkg-config file
|
2020-08-03 19:21:14 +00:00
|
|
|
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;
|
2012-08-27 11:17:02 +00:00
|
|
|
|
|
|
|
meta = {
|
2021-10-09 16:05:45 +00:00
|
|
|
homepage = "https://qcad.org/en/90-dxflib";
|
2022-11-03 23:26:43 +00:00
|
|
|
maintainers = with lib.maintainers; [ raskin ];
|
|
|
|
platforms = lib.platforms.unix;
|
2021-01-16 04:20:42 +00:00
|
|
|
description = "DXF file format library";
|
2012-08-27 11:17:02 +00:00
|
|
|
};
|
|
|
|
}
|