2023-11-08 04:10:42 +00:00
|
|
|
{ mkDerivation, lib, stdenv, fetchFromGitHub, fetchpatch, qtbase, vcg, glew, qmake, libGLU, eigen, libGL }:
|
2017-05-13 08:38:19 +00:00
|
|
|
|
2016-02-17 12:53:32 +00:00
|
|
|
|
2020-04-07 20:29:34 +00:00
|
|
|
mkDerivation {
|
2021-11-07 20:29:51 +00:00
|
|
|
pname = "openbrf";
|
|
|
|
version = "unstable-2016-01-09";
|
2016-02-17 12:53:32 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "cfcohen";
|
|
|
|
repo = "openbrf";
|
2017-05-13 08:38:19 +00:00
|
|
|
rev = "4bdc66e38def5e5184f5379c84a7558b7484c70a";
|
|
|
|
sha256 = "16254cnr60ihcn7bki7wl1qm6gkvzb99cn66md1pnb7za8nvzf4j";
|
2016-02-17 12:53:32 +00:00
|
|
|
};
|
|
|
|
|
2023-11-08 04:10:42 +00:00
|
|
|
patches = [
|
|
|
|
# https://github.com/cfcohen/openbrf/pull/7
|
|
|
|
(fetchpatch {
|
|
|
|
name = "fix-build-against-newer-vcglib.patch";
|
|
|
|
url = "https://github.com/cfcohen/openbrf/commit/6d82a25314a393e72bfbe2ffc3965bcac407df4c.patch";
|
|
|
|
hash = "sha256-rNxAw6Le6QXMSirIAMhMmqVgNJLq6osnEOhWrY3mTpM=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [ qtbase vcg glew eigen ];
|
2016-02-17 12:53:32 +00:00
|
|
|
|
2017-05-17 19:26:11 +00:00
|
|
|
nativeBuildInputs = [ qmake ];
|
2016-02-17 12:53:32 +00:00
|
|
|
|
2016-04-16 23:34:22 +00:00
|
|
|
qmakeFlags = [ "openBrf.pro" ];
|
|
|
|
|
2023-11-08 04:10:42 +00:00
|
|
|
env.NIX_CFLAGS_COMPILE = "-isystem ${lib.getDev eigen}/include/eigen3";
|
|
|
|
|
2016-02-17 12:53:32 +00:00
|
|
|
postPatch = ''
|
|
|
|
sed -i 's,^VCGLIB .*,VCGLIB = ${vcg}/include,' openBrf.pro
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
2017-05-13 08:38:19 +00:00
|
|
|
install -Dm755 openBrf $out/share/openBrf/openBrf
|
|
|
|
install -Dm644 carry_positions.txt $out/share/openBrf/carry_positions.txt
|
|
|
|
install -Dm644 reference.brf $out/share/openBrf/reference.brf
|
|
|
|
|
|
|
|
patchelf \
|
2021-01-15 05:42:41 +00:00
|
|
|
--set-rpath "${lib.makeLibraryPath [ qtbase glew stdenv.cc.cc libGLU libGL ]}" \
|
2017-05-13 08:38:19 +00:00
|
|
|
$out/share/openBrf/openBrf
|
|
|
|
|
2017-09-09 02:25:37 +00:00
|
|
|
mkdir -p "$out/bin"
|
2017-05-17 19:26:11 +00:00
|
|
|
ln -s "$out/share/openBrf/openBrf" "$out/bin/openBrf"
|
2016-02-17 12:53:32 +00:00
|
|
|
'';
|
|
|
|
|
2017-05-13 08:38:19 +00:00
|
|
|
dontPatchELF = true;
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2016-02-17 12:53:32 +00:00
|
|
|
description = "Tool to edit resource files (BRF)";
|
2024-03-19 02:14:51 +00:00
|
|
|
mainProgram = "openBrf";
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://github.com/cfcohen/openbrf";
|
2021-01-15 05:42:41 +00:00
|
|
|
maintainers = with lib.maintainers; [ abbradar ];
|
2016-02-17 12:53:32 +00:00
|
|
|
license = licenses.free;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|