diff --git a/lib/maintainers.nix b/lib/maintainers.nix index d06cea51e675..b7b5232c170b 100644 --- a/lib/maintainers.nix +++ b/lib/maintainers.nix @@ -389,6 +389,7 @@ lufia = "Kyohei Kadota "; luispedro = "Luis Pedro Coelho "; lukego = "Luke Gorrie "; + luz = "Luz "; lw = "Sergey Sofeychuk "; lyt = "Tim Liou "; m3tti = "Mathaeus Sander "; diff --git a/pkgs/applications/science/electronics/librepcb/default.nix b/pkgs/applications/science/electronics/librepcb/default.nix new file mode 100644 index 000000000000..f4418f535632 --- /dev/null +++ b/pkgs/applications/science/electronics/librepcb/default.nix @@ -0,0 +1,33 @@ +{ stdenv, fetchFromGitHub, qtbase, qttools, qmake, mesa, openssl, zlib }: + +stdenv.mkDerivation rec { + name = "librepcb-${version}"; + version = "20171229"; + + src = fetchFromGitHub { + owner = "LibrePCB"; + repo = "LibrePCB"; + fetchSubmodules = true; + rev = "4efb06fa42755abc5e606da4669cc17e8de2f8c6"; + sha256 = "0r33fm1djqpy0dzvnf5gv2dfh5nj2acaxb7w4cn8yxdgrazjf7ak"; + }; + + enableParallelBuilding = true; + + nativeBuildInputs = [ qmake qttools ]; + + buildInputs = [ qtbase ]; + + # LibrePCB still supports QT below 5.9. But some code lines break the build, so they are removed by this patch so that the software builds. + patches = [ ./fix-2017-12.patch ]; + + qmakeFlags = ["-r"]; + + meta = with stdenv.lib; { + description = "A free EDA software to develop printed circuit boards"; + homepage = http://librepcb.org/; + maintainers = with maintainers; [ luz ]; + license = licenses.gpl3; + platforms = platforms.linux; + }; +} diff --git a/pkgs/applications/science/electronics/librepcb/fix-2017-12.patch b/pkgs/applications/science/electronics/librepcb/fix-2017-12.patch new file mode 100644 index 000000000000..75fc590ad7fe --- /dev/null +++ b/pkgs/applications/science/electronics/librepcb/fix-2017-12.patch @@ -0,0 +1,29 @@ +--- a/libs/librepcb/common/fileio/serializableobjectlist.h ++++ b/libs/librepcb/common/fileio/serializableobjectlist.h +@@ -374,26 +374,6 @@ + } // namespace librepcb + + /***************************************************************************************** +- * Prevent from using SerializableObjectList in a foreach loop because it always would +- * create a deep copy of the list! You should use C++11 range based for loops instead. +- ****************************************************************************************/ +- +-#if (QT_VERSION > QT_VERSION_CHECK(5, 9, 0)) +-#define QFOREACHCONTAINER_TEMPLATE QtPrivate::QForeachContainer +-#else +-#define QFOREACHCONTAINER_TEMPLATE QForeachContainer +-#endif +- +-template +-class QFOREACHCONTAINER_TEMPLATE> { public: +- ~QForeachContainer() = delete; +-}; +-template +-class QFOREACHCONTAINER_TEMPLATE> { public: +- ~QForeachContainer() = delete; +-}; +- +-/***************************************************************************************** + * End of File + ****************************************************************************************/ + diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 68244c40b1e1..1136208bf30c 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -19179,6 +19179,8 @@ with pkgs; boost = boost160; }; + librepcb = libsForQt5.callPackage ../applications/science/electronics/librepcb { }; + ngspice = callPackage ../applications/science/electronics/ngspice { }; pcb = callPackage ../applications/science/electronics/pcb { };