2020-11-21 19:51:51 +00:00
|
|
|
{ stdenv, lib, fetchFromGitHub
|
|
|
|
, qtbase, qttools, qmake, wrapQtAppsHook
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-11-21 19:51:51 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "librepcb";
|
2020-11-09 15:59:12 +00:00
|
|
|
version = "0.1.5";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2020-11-21 19:51:51 +00:00
|
|
|
owner = pname;
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2020-11-09 15:59:12 +00:00
|
|
|
sha256 = "0ag8h3id2c1k9ds22rfrvyhf2vjhkv82xnrdrz4n1hnlr9566vcx";
|
2020-11-21 19:51:51 +00:00
|
|
|
fetchSubmodules = true;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ qmake qttools wrapQtAppsHook ];
|
|
|
|
buildInputs = [ qtbase ];
|
|
|
|
|
|
|
|
qmakeFlags = ["-r"];
|
2020-11-21 19:51:51 +00:00
|
|
|
enableParallelBuilding = true;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
postInstall = ''
|
2020-11-21 19:51:51 +00:00
|
|
|
mkdir -p $out/share/librepcb/fontobene
|
|
|
|
cp share/librepcb/fontobene/newstroke.bene $out/share/librepcb/fontobene/
|
|
|
|
'';
|
|
|
|
|
|
|
|
# the build system tries to use 'git' at build time to find the HEAD hash.
|
|
|
|
# that's a no-no, so replace it with a quick hack. NOTE: the # adds a comment
|
|
|
|
# at the end of the line to remove the git call.
|
|
|
|
patchPhase = ''
|
|
|
|
substituteInPlace ./libs/librepcb/common/common.pro \
|
|
|
|
--replace 'GIT_COMMIT_SHA' 'GIT_COMMIT_SHA="\\\"${src.rev}\\\"" # '
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
preFixup = ''
|
|
|
|
wrapQtApp $out/bin/librepcb
|
|
|
|
'';
|
|
|
|
|
2020-11-21 19:51:51 +00:00
|
|
|
meta = with stdenv.lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "A free EDA software to develop printed circuit boards";
|
2020-11-21 19:51:51 +00:00
|
|
|
homepage = "https://librepcb.org/";
|
|
|
|
maintainers = with maintainers; [ luz thoughtpolice ];
|
|
|
|
license = licenses.gpl3;
|
|
|
|
platforms = platforms.linux;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|