diff --git a/pkgs/applications/science/misc/openmodelica/default.nix b/pkgs/applications/science/misc/openmodelica/default.nix new file mode 100644 index 000000000000..8420d445e099 --- /dev/null +++ b/pkgs/applications/science/misc/openmodelica/default.nix @@ -0,0 +1,42 @@ +{stdenv, fetchgit, fetchsvn, autoconf, automake, libtool, gfortran, clang, cmake, gnumake, +hwloc, jre, liblapack, blas, hdf5, expat, ncurses, readline, qt4, webkit, which, +lp_solve, omniorb, sqlite, libatomic_ops, pkgconfig, file, gettext, flex, bison, +doxygen, boost, openscenegraph, gnome, pangox_compat, xlibs, git, bash, gtk }: + +let + + fakegit = import ./fakegit.nix {inherit stdenv fetchgit fetchsvn bash;} ; + +in + +stdenv.mkDerivation { + name = "openmodelica"; + + src = fetchgit (import ./src-main.nix); + + buildInputs = [autoconf cmake automake libtool gfortran clang gnumake + hwloc jre liblapack blas hdf5 expat ncurses readline qt4 webkit which + lp_solve omniorb sqlite libatomic_ops pkgconfig file gettext flex bison + doxygen boost openscenegraph gnome.gtkglext pangox_compat xlibs.libXmu + git gtk]; + + patchPhase = '' + cp -fv ${fakegit}/bin/checkout-git.sh libraries/checkout-git.sh + cp -fv ${fakegit}/bin/checkout-svn.sh libraries/checkout-svn.sh + ''; + + configurePhase = '' + autoconf + ./configure CC=${clang}/bin/clang CXX=${clang}/bin/clang++ --prefix=$out + ''; + + meta = with stdenv.lib; { + description = "OpenModelica is an open-source Modelica-based modeling and simulation environment"; + homepage = "https://openmodelica.org"; + license = licenses.gpl3; + maintainers = with maintainers; [ smironov ]; + platforms = platforms.linux; + }; +} + + diff --git a/pkgs/applications/science/misc/openmodelica/fakegit.nix b/pkgs/applications/science/misc/openmodelica/fakegit.nix new file mode 100644 index 000000000000..de69626cd3ee --- /dev/null +++ b/pkgs/applications/science/misc/openmodelica/fakegit.nix @@ -0,0 +1,81 @@ +{stdenv, fetchgit, fetchsvn, bash } : + +let + mkscript = path : text : '' + mkdir -pv `dirname ${path}` + cat > ${path} <<"EOF" + #!${bash}/bin/bash + ME=`basename ${path}` + ${text} + EOF + sed -i "s@%out@$out@g" ${path} + chmod +x ${path} + ''; + + hashname = r: let + rpl = stdenv.lib.replaceChars [":" "/"] ["_" "_"]; + in + (rpl r.url) + "-" + (rpl r.rev); + +in + +stdenv.mkDerivation { + name = "fakegit"; + + buildCommand = '' + mkdir -pv $out/repos + ${stdenv.lib.concatMapStrings + (r : '' + cp -r ${fetchgit r} $out/repos/${hashname r} + '' + ) (import ./src-libs-git.nix) + } + + ${mkscript "$out/bin/checkout-git.sh" '' + if test "$#" -ne 4; then + echo "Usage: $0 DESTINATION URL GITBRANCH HASH" + exit 1 + fi + DEST=$1 + URL=`echo $2 | tr :/ __` + GITBRANCH=$3 + REVISION=$4 + + L=`echo $REVISION | wc -c` + if expr $L '<' 10 >/dev/null; then + REVISION=refs/tags/$REVISION + fi + + REVISION=`echo $REVISION | tr :/ __` + + rm -rf $DEST + mkdir -pv $DEST + echo "FAKEGIT cp -r %out/repos/$URL-$REVISION $DEST" >&2 + cp -r %out/repos/$URL-$REVISION/* $DEST + chmod u+w -R $DEST + ''} + + ${stdenv.lib.concatMapStrings + (r : '' + cp -r ${fetchsvn r} $out/repos/${hashname r} + '' + ) (import ./src-libs-svn.nix) + } + + ${mkscript "$out/bin/checkout-svn.sh" '' + if test "$#" -ne 3; then + echo "Usage: $0 DESTINATION URL REVISION" + exit 1 + fi + DEST=$1 + URL=`echo $2 | tr :/ __` + REVISION=`echo $4 | tr :/ __` + + rm -rf $DEST + mkdir -pv $DEST + echo "FAKE COPY %out/repos/$URL-$REVISION $DEST" + cp -r %out/repos/$URL-$REVISION/* $DEST + chmod u+w -R $DEST + ''} + ''; +} diff --git a/pkgs/applications/science/misc/openmodelica/src-libs-git.nix b/pkgs/applications/science/misc/openmodelica/src-libs-git.nix new file mode 100644 index 000000000000..aae5ab321fbe --- /dev/null +++ b/pkgs/applications/science/misc/openmodelica/src-libs-git.nix @@ -0,0 +1,71 @@ +[ +{ url = "https://github.com/modelica-3rdparty/ADGenKinetics.git"; rev = "42428db6e84bcde28543a3bba9bccee581309bb1"; sha256="14l005jwj1wz35gq8xlbzfz0bpsx99rs4q3dxkfh76yhnv1jh9h3"; } +{ url = "https://github.com/modelica-3rdparty/ADMSL.git"; rev = "ed0305603f86b46d9af03e7d37dcb8b6704915b4"; sha256="15b0nqxyh8444az56ydjn594jikdl1ina5wamabk3nzm1yx218cl"; } +{ url = "https://github.com/iea-annex60/modelica-annex60.git"; rev = "8015a01591bb24d219f57e7b69cdfcde66e39b47"; sha256="05k4pa007a6p628fq1xac0cfv8g8dnpy2bgy8h99rqpmlaa072z7"; } +{ url = "https://github.com/OpenModelica/BioChem.git"; rev = "b5f3cb999f3cfad2bbb6fb429b496f61ecf2f628"; sha256="1l52dg888vwx4668spn59hqvfkpl9g06g8n2cdxiap7lvsyh6w9x"; } +{ url = "https://github.com/modelica-3rdparty/BondGraph.git"; rev = "20c23e60d12989bd4668ccac47659d82d39d29cc"; sha256="1i9cmiy1ya04h2ld0gy0x2gvdrfksl66fmcrgdm1vpsnbb6pviv9"; } +{ url = "https://github.com/modelica-3rdparty/BondLib.git"; rev = "df7a40fe612617da22e27d39edfa4b27d65f23d0"; sha256="005djwxd568zyk3ndss9hv165dci9x0dgjmcdjhnqmsap3w83hlz"; } +{ url = "https://github.com/modelica-3rdparty/BrineProp.git"; rev = "fed013cdeec0fb9552964376b575a8e3635539ab"; sha256="020hm2q65d5iv3h8b3lhgl6j930vi2pbh4lvxv3b3k7i9z02q43a"; } +{ url = "https://github.com/lbl-srg/modelica-buildings.git"; rev = "ef89361cc8673b077b9221efbf78aa63b4d7babd"; sha256="04gclknhl2f5z7w9fsbhwawisd0ibmvwpplx0siqwzvjx7nsmdg4"; } +{ url = "https://github.com/lbl-srg/modelica-buildings.git"; rev = "444aa231f423b8d04225bf8672e3212d089fbfe4"; sha256="0q754mlkwqj0jcqsmxksvcz4ak2i86f9s41fhffh5jvra27cvq01"; } +{ url = "https://github.com/modelica-3rdparty/Chemical.git"; rev = "aa2642608e587ddb6897e8c3ffabb3aa099510bd"; sha256="0y46spcb6rw0jpj4v20nlw8xlvi5kypij46f1msvwgr7dfgy4gl4"; } +{ url = "https://github.com/modelica-3rdparty/ComplexLib.git"; rev = "0b78942ee4fa95ae71347a0d552dd869fdf4c708"; sha256="18llf5ccrq3b0f4cjznfycskwf78pik8370xv45w9gb51gamszrn"; } +{ url = "https://github.com/lochel/ConPNlib.git"; rev = "bbf6e9711665d55e5a8cf2f7235fa013c2315104"; sha256="0g3ll44sn2ff14qxwdyakw9h5b8b7vzabxp8cb8km16wcdqzgcxx"; } +{ url = "https://github.com/modelica-3rdparty/DESLib.git"; rev = "7a473d8d16b118c3ea05761c6f43b17fd9838e4e"; sha256="19f2121n8rdc9svcjk8irivsd9wqcb9ai9jx72s2r85fkbvm8jc3"; } +{ url = "https://github.com/modelica-3rdparty/ExtendedPetriNets.git"; rev = "2f4eac0651c1ab0ed56b75ec61424e0ef15181d3"; sha256="0wwj756pg33qwb90ycbfkrk5xsiwsbrqvq3i16i4pisi21vl6jk9"; } +{ url = "https://github.com/modelica-3rdparty/ExternData.git"; rev = "396164fa708cc7c7e64da55ac0b3cba23939f790"; sha256="09052qmv91a9wawsl93b5b3q47awrxhnsbb9mrv39kpnwygfh7dq"; } +{ url = "https://github.com/modelica/ExternalMedia.git"; rev = "1b77869b31dc3509defeccb1236db4b05d2f6f5b"; sha256="05sszn4bn8r78syydyjq8csn9xv4az56mm9lrarqykqdh78pvlqp"; } +{ url = "https://github.com/kdavies4/FCSys.git"; rev = "cb4b17f34313b9d8f2d4223d5365684b4dc1ab65"; sha256="114p7ja6b3fwlkvkkjhbx78fxc7v4af2sbs783hkdga86m1v4ib6"; } +{ url = "https://github.com/modelica-3rdparty/FastBuildings.git"; rev = "1f5cfebc2f42c13e272bff639ffa3449d5740bf7"; sha256="0sry1n2pliddz0pjv8dp899fx98f16n1arc8zvq36k5grvi52fby"; } +{ url = "https://github.com/modelica-3rdparty/FaultTriggering.git"; rev = "10c226b7e5b2af901b356ac437c90d6616a6e9a4"; sha256="0a9j18qjwigq11nghl97syxa9bscs1aj6vwpkldh50csnj5h6g2s"; } +{ url = "https://github.com/modelica-3rdparty/FuzzyControl.git"; rev = "19ff67ff129a440482cc85f216f287b05ea6ec0d"; sha256="0ijcqns7pijsavijn4wlrdsz64k5ks626sly7r28wvrk9af2m2cx"; } +{ url = "https://github.com/modelica-3rdparty/HelmholtzMedia.git"; rev = "e54fcd0e436d65c85de6c6b935983e363cdc9f6c"; sha256="05afh0379fx4mjjn7jb8j5p4am6qi62hjxvasb38b6fcp9rnysn4"; } +{ url = "https://github.com/modelica-3rdparty/IdealizedContact.git"; rev = "8ebac550d913f6d2b3af4d1aea5044e72c7eb6b0"; sha256="03gh2a7hf44clshwkiyz786w847hmyr3bicdqd9969fbirgcqn6m"; } +{ url = "https://github.com/modelica-3rdparty/IndustrialControlSystems.git"; rev = "6a2414307d5998c6d081efe803c2b575a532b3ba"; sha256="09la9h07x8bkh7zhrwykgj1467qdryjvxhvnnm8qvsim0dl9inc4"; } +{ url = "https://github.com/modelica-3rdparty/LinearMPC.git"; rev = "1e91a5dcaa662cd30c5b09a9d0267289703f933b"; sha256="12094fqmwi65h0mc65b96krbj6b8dgn6jiww3fnv6khglb21kwvd"; } +{ url = "https://github.com/modelica/Modelica.git"; rev = "refs/tags/v1.6"; sha256="106w83ylgbxf63wr7p9z5q8vqz2qcsaw0zwaad7d3saq6rdbj30c"; } +{ url = "https://github.com/modelica/Modelica.git"; rev = "d442bcd461b8db9873e33b6141bdbd37bcff9de8"; sha256="1icnd0fxix5khnsvdhy7kmzn6lnqkggbvfrbln98a2h5zqd6s32w"; } +{ url = "https://github.com/modelica/Modelica.git"; rev = "af2a3e1597d648d6826665c89cf9eaf5c2a632bc"; sha256="0ryk0iwakdazhsjqvan41w6f9bvgl329zkqchcdg6nkidiigziwh"; } +{ url = "https://github.com/modelica/Modelica.git"; rev = "48943d87db45a6c312b5a5789d384acde44a934b"; sha256="1hi2vkpmx734baa9m1lqzallcykhh3snd68r387gndiv96f6zx3n"; } +{ url = "https://github.com/modelica/Modelica.git"; rev = "164af873cc5955c50f9592a7d2f3c155f703849c"; sha256="071svqwd72sy85sngbg5r22ab693c0gw2xx29gk1sqrk2nchmvia"; } +{ url = "https://github.com/OpenModelica/modelica3d.git"; rev = "daf5669b03ad33fc6999671d1c0e7521134a282b"; sha256="1scs6v2cp2r4jz4diszwbqf9kvzf49pid50dmpsz0gfhx06j9y2v"; } +{ url = "https://github.com/modelica-deprecated/ModelicaAdditions.git"; rev = "568db43766186826b880f9d4bfafeff25cc2c4ab"; sha256="1py5i3afxdvz1dmxxwb2mqj8kyzdhg4jnnqwl8h50akizg4i49pl"; } +{ url = "https://github.com/xogeny/ModelicaBook.git"; rev = "0e670cfae4db653bd34ea777d6b56423e9be2c9f"; sha256="0lxh08w6nii4p5yk7c0xmfi5y4xkjkzz4hirr3kqdhdfybcwq824"; } +{ url = "https://github.com/modelica-compliance/compliance.git"; rev = "ca5092c14bb7af4507a10700ee49181a3a3ee199"; sha256="12ja6dhwlbq412kxjdviypgchipxpsg8l0sf6r17g6lbsi19i2b6"; } +{ url = "https://github.com/modelica-3rdparty/ModelicaDEVS.git"; rev = "a987aa9552fbbe71b2ee2e8c28958f9d213087ae"; sha256="0qcw7vw28xadim0h8kr2km09d8vdj05ibdpzcnpny9n43pm9s5hx"; } +{ url = "https://github.com/modelica/Modelica_DeviceDrivers.git"; rev = "db912ba7e1317b8f6a776ccf9a19f69c77a9c477"; sha256="052h2lr7xgfag5fks19wbldqmb985kxlc5fzysl7c9w3fnijp0ml"; } +{ url = "https://github.com/modelica/Modelica_EnergyStorages.git"; rev = "9f057365232364e31a31a8e525f96284b98c7de3"; sha256="195m5b3z8qgg9kih9zsdx1h8zgrm37q63890r59akka05a97j48h"; } +{ url = "https://github.com/modelica/Modelica_LinearSystems2.git"; rev = "18916fdc485285baab12481701b53d4eb606a3f1"; sha256="0fhvdwcgk8q3z1a98l2bxv8a6dysrs4ll6xfyzpni7yq8gp4mg4q"; } +{ url = "https://github.com/modelica/Modelica_Synchronous.git"; rev = "d0f5ee57bc7b639738e88026674a87343b33dbe1"; sha256="0l75v4d0fgf07ify0h3skh4y9pfw9gxh9hbj1lbsdgglmzlrcvbg"; } +{ url = "https://github.com/modelica-3rdparty/MotorcycleDynamics.git"; rev = "2be2667f9936d88ffb9b8a8246c5af9ccb0b307f"; sha256="0jazwmpqpyhhgs9qdn9drmplgp2yjs0ky7wll5x9929dkgy80m6x"; } +{ url = "https://github.com/modelica-3rdparty/NCLib.git"; rev = "ed3d72f176ac6b7031ce73be9d80101141e74a69"; sha256="1pbpv8w1lsa9vdwp7qbih8iim91ms22b01wz376b548d0x2r95la"; } +{ url = "https://github.com/modelica-3rdparty/NeuralNetwork.git"; rev = "c44e4d1fe97fd4f86dafcd05ad3713692e3f1806"; sha256="0s1v8k71zq1s9gjlvi3zr23nwfknp4x17cxm64a0y3vsi3kahj2s"; } +{ url = "https://github.com/DLR-SR/Noise.git"; rev = "9b57476845539e56769cf76ea0fe7bf3c7eb5d11"; sha256="0icrb63f6dm4gww2nyby9i7s7qxvhvialp36xzcgmi7nlq7crjr2"; } +{ url = "https://github.com/modelica-3rdparty/ObjectStab.git"; rev = "2a723e0b223af50f4ffdd62f8ac901e0f87b9323"; sha256="1b6zi27slzzfbkmbcqxygsn5i5w0zkq0hfrfb72vf7mbgz07j19j"; } +{ url = "https://github.com/cparedis/OpenHydraulics.git"; rev = "d3173d1f06f7d14c9d7c41769f143617ff03a3ad"; sha256="1hn5rcnmzcbiaqdnxfn02wddmrpj9bcdi9p680f31hbh3vb0i3r6"; } +{ url = "https://github.com/lochel/PNlib.git"; rev = "44c7d277980b7a88b449b72edec0a56416b40fa9"; sha256="026wdhbxnzarmj8gw0as70vj8f1gwc51z38hjqpswxkl0xd6mfvp"; } +{ url = "https://github.com/MarekMatejak/Physiolibrary.git"; rev = "49d59060f6e5b4cb68560c6d7467e84ea4318056"; sha256="0klqs2axjm3s780sq4plq4wmbf9mszz2jmq9fprgxy9pw7iszbhc"; } +{ url = "https://github.com/dzimmer/PlanarMechanics.git"; rev = "d998a1b27355e83d2ff4849d71281a919a3234aa"; sha256="0vyq6mninn38wy2d60rk753xbkfqim2y6y31py7kq2mm170jfqf4"; } +{ url = "https://github.com/modelica/PowerSystems.git"; rev = "7b551888089277a0dd979db636d47aba0279e8f0"; sha256="0y13f1nllc7riksnly25wmmp6mc30c1b48dbq2lr1nag6yg3blwm"; } +{ url = "https://github.com/modelica/PowerSystems.git"; rev = "3abd48aa53bbcd3f3e2ddfa2371680febf8baf48"; sha256="1nr2nbpaxywk8cpwnk9rr2zr87mm2gb9b4plqipjdlrrkjlk9fka"; } +{ url = "https://github.com/modelica-3rdparty/PraxisSimulationstechnik.git"; rev = "f7db177786f84033f3a50b7474988b190a1dfb46"; sha256="08bdm7k7w35kg9gkrvcn382zkwf5h3iwkkx60d5fj64j5d5klray"; } +{ url = "https://github.com/modelica-3rdparty/QCalc.git"; rev = "af6c34dda691a9bdf7ca1de10650974b2d5cecf5"; sha256="0p0zhl27cnr492byrzib0dyn7zp5yb7wcr0spv10ngm6j90cij6y"; } +{ url = "https://github.com/modelica-3rdparty/QSSFluidFlow.git"; rev = "d84a2c107132f2cd47ea3c3751238d69e4b1f64b"; sha256="02cdvv33pi0qlmg8n401s4cxf59l9b4ff4ixf7gwn4w4n1y9bw0g"; } +{ url = "https://github.com/modelica-3rdparty/RealTimeCoordinationLibrary.git"; rev = "655ac1a22aa6deb04ea8e3869dd0aa9fb9540754"; sha256="19crf8pl9vpqq3pq1rhcbl49kkmnm4jrzpwrpqp8qc6dj8096za4"; } +{ url = "https://github.com/modelica-3rdparty/ScalableTestSuite.git"; rev = "c6319908d45ac97ffb10e96cd42654bce36ffb97"; sha256="1g79d88bfmzcqvaghyyj86ajs38v0qnmjxbj8d53yp6nmgnaasx5"; } +{ url = "https://github.com/modelica-3rdparty/Servomechanisms.git"; rev = "22e1874ef9ad46156617817c67a4fb1238621bf5"; sha256="0nwb7apayk7ba9iv27yv67wi4b934dy57kkvn0acxy393jhd8jqd"; } +{ url = "https://openmodelica.org/git/SiemensPower.git"; rev = "73a3bfc6d2ddd72165bb0f3e7e9df48b643a5ed0"; sha256="0mvrkpkmr0bx2cvsb23syg7cs8k6a15vjf4n1hivdcigq4x8g2nc"; } +{ url = "https://openmodelica.org/git/SiemensPower.git"; rev = "5ef2e38b64ff481801c0db19d52f0bef21f85f77"; sha256="1llnpl2x1g28gari1rk34hdnnwf7a4fwwxlf7i18d8bl1vsrfaja"; } +{ url = "https://openmodelica.org/git/SiemensPower.git"; rev = "2bd9e367baaa8d44946897c3c3a32a4050ad2a2a"; sha256="1shm9blpn9m87ci6wwkinpmihr1fik9j0a0pj2nxy0cjrr2jzbn4"; } +{ url = "https://github.com/modelica-3rdparty/Spot.git"; rev = "2f74417f1681570900a1ed373dcbe4b42634ec7b"; sha256="0k5h2k6x98zvvsafpw7y16xs9d6lxz0csa0mlm4wwggaywadn255"; } +{ url = "https://github.com/modelica-3rdparty/SystemDynamics.git"; rev = "c58a26dc3e62a50e64fd336dc4aa499b2d5ad314"; sha256="0ra3a2vgqmry92kmm060gfa41mrpkgbs4swzl78ih3icawfzjz8q"; } +{ url = "https://github.com/modelica-3rdparty/ThermoPower.git"; rev = "e012268625dd1645fe5570cf31d64129d83a8192"; sha256="1rlkli48kc9hnkplgb0bjkb6ajn7agiw4yh9l5sfvlv7k7k2gc8l"; } +{ url = "https://openmodelica.org/git/ThermoSysPro.git"; rev = "d4f9c3ed35f7520f82439eb6e9f4057ae0f82b73"; sha256="0hxbn26g479qkr6rrglx9ljdxnpzd5ll1sf2v08skghrdjjb8jcx"; } +{ url = "https://openmodelica.org/git/ThermoSysPro.git"; rev = "51e7ea2d2e121ee640e7897335c294923f8eaeb0"; sha256="0l11mzjkaxndsqrnnr0z7qvk08svv229119qkm81yb53ich9wnyw"; } +{ url = "https://github.com/modelica/VehicleInterfaces.git"; rev = "ad956a35643d53e207ee126d67ea1f3f38337a39"; sha256="0g90cqwjpi06gn7vca5kqnz56im76s2hrdqjhsj2bl43rza8mhr0"; } +{ url = "https://github.com/modelica-3rdparty/WasteWater.git"; rev = "90ff44ac791ba5ed98444c8597efbd2a2af01cad"; sha256="1icrn0y389rhxmf6i0mnsfgw9v9j5innpkz3q069rfm2ji268b12"; } +{ url = "https://github.com/xogeny/XogenyTest.git"; rev = "9b98981e8ff0f440dd319d1a806e1fd2f0ab3436"; sha256="18glaxrlxfml26w7ljlf0yj3ah1fnhpbg01py28nplsgnrfwfwqj"; } +{ url = "https://github.com/modelica-3rdparty/msgpack-modelica.git"; rev = "6ce2ca600c4902038c0f20b43ed442f1ee204310"; sha256="01x5a9y11yf62sc0j2y49yxwm24imj2lfl3z5mwvi9038gwn0lkx"; } +{ url = "https://github.com/modelica-3rdparty/netCDF-DataReader.git"; rev = "3d2cc8272abfbc4b667d8868f851bf3e11c6f00e"; sha256="194810a4rn0flxgirrlnxsbxarnm97309dkp1w7nva9zv1q3wj7h"; } +{ url = "https://github.com/joewa/open-bldc-modelica.git"; rev = "7817cd703b88fc1f433269d32c31e75eb50a21c6"; sha256="1plkxkx51f9yi99ysarmx2ymldizvyr0m66k996y5lj5h81jv8a8"; } +] diff --git a/pkgs/applications/science/misc/openmodelica/src-libs-svn.nix b/pkgs/applications/science/misc/openmodelica/src-libs-svn.nix new file mode 100644 index 000000000000..244da64fb4e6 --- /dev/null +++ b/pkgs/applications/science/misc/openmodelica/src-libs-svn.nix @@ -0,0 +1,5 @@ +[ +{ url = "https://svn.modelica.org/projects/Modelica_ElectricalSystems/InstantaneousSymmetricalComponents"; rev = "7978"; sha256="0f100c7bz4ai3ryhpkbbszw8z6mykvg40p03ic92n2qq58wjk37z"; } +{ url = "https://svn.modelica.org/projects/Modelica_EmbeddedSystems/trunk/Modelica_StateGraph2"; rev = "8121"; sha256="1cys57nc1yzkr5admc139qs5pa48rj3g69pb3j3s9xcmpd483hzp"; } +{ url = "https://svn.modelica.org/projects/Modelica_ElectricalSystems/Modelica_PowerFlow/trunk"; rev = "3174"; sha256="0yviw1b8psn8vfyl4q1naylak3lcqi2q1bqplqg3gg9iw4aiymxl"; } +] diff --git a/pkgs/applications/science/misc/openmodelica/src-main.nix b/pkgs/applications/science/misc/openmodelica/src-main.nix new file mode 100644 index 000000000000..16910675a05b --- /dev/null +++ b/pkgs/applications/science/misc/openmodelica/src-main.nix @@ -0,0 +1,6 @@ +{ + url = "https://openmodelica.org/git-readonly/OpenModelica.git"; + fetchSubmodules = true; + rev = "8c5d48eb31a638d5220621b20377bfe6f9e9535e"; + sha256 = "15r0qpvnsb9a7nw3bh5n9r770ngd7p5py0ld2jy5mc4llaslkpa5"; +} diff --git a/pkgs/applications/science/misc/openmodelica/update-src-libs-git.sh b/pkgs/applications/science/misc/openmodelica/update-src-libs-git.sh new file mode 100755 index 000000000000..481a89796415 --- /dev/null +++ b/pkgs/applications/science/misc/openmodelica/update-src-libs-git.sh @@ -0,0 +1,64 @@ +#!/bin/sh + +CWD=`pwd` + +chko() { ( +T=`mktemp -d` +trap "rm -rf $T" EXIT INT PIPE +cd $T +cat >check.nix < {}; +fetchgit `cat $CWD/src-main.nix` +EOF +nix-build check.nix +cat result/libraries/Makefile.libs +) } + +getsha256() { ( +T=`mktemp -d` +trap "rm -rf $T" EXIT INT PIPE +cd $T + +L=`echo $2 | wc -c` +if expr $L '<' 10 >/dev/null; then +T=`echo $2 | sed 's@"\(.*\)"@"refs/tags/\1"@'` +cat >check.nix < {}; +fetchgit { + url = $1; + rev = $T; + sha256 = "0000000000000000000000000000000000000000000000000000"; +} +EOF +SHA=`nix-build check.nix 2>&1 | sed -n 's/.*instead has ‘\(.*\)’.*/\1/g p'` +echo "{ url = $1; rev = $T; sha256=\"$SHA\"; }" +else +cat >check.nix < {}; +fetchgit { + url = $1; + rev = $2; + sha256 = "0000000000000000000000000000000000000000000000000000"; +} +EOF +SHA=`nix-build check.nix 2>&1 | sed -n 's/.*instead has ‘\(.*\)’.*/\1/g p'` +echo "{ url = $1; rev = $2; sha256=\"$SHA\"; }" +fi + +# nix-build check.nix +) } + +OUT=src-libs-git.nix + +echo '[' > $OUT + +chko | +grep checkout-git.sh | +tr \' \" | +while read NM TGT URL BR REV ; do + echo Trying $TGT $URL $REV >&2 + getsha256 $URL $REV >> $OUT || exit 1 +done + +echo ']' >> $OUT + diff --git a/pkgs/applications/science/misc/openmodelica/update-src-libs-svn.sh b/pkgs/applications/science/misc/openmodelica/update-src-libs-svn.sh new file mode 100755 index 000000000000..972bc7d61f13 --- /dev/null +++ b/pkgs/applications/science/misc/openmodelica/update-src-libs-svn.sh @@ -0,0 +1,50 @@ +#!/bin/sh + +CWD=`pwd` + +chko() { ( +T=`mktemp -d` +trap "rm -rf $T" EXIT INT PIPE +cd $T +cat >check.nix < {}; +fetchgit `cat $CWD/src-main.nix` +EOF +nix-build check.nix +cat result/libraries/Makefile.libs +) } + +getsha256() { ( +T=`mktemp -d` +trap "rm -rf $T" EXIT INT PIPE +cd $T + +L=`echo $2 | wc -c` +cat >check.nix < {}; +fetchsvn { + url = $1; + rev = $2; + sha256 = "0000000000000000000000000000000000000000000000000000"; +} +EOF +SHA=`nix-build check.nix 2>&1 | sed -n 's/.*instead has ‘\(.*\)’.*/\1/g p'` +echo "{ url = $1; rev = $2; sha256=\"$SHA\"; }" + +# nix-build check.nix +) } + +OUT=src-libs-svn.nix + +echo '[' > $OUT + +chko | +grep checkout-svn.sh | +tr \' \" | +while read NM TGT URL REV ; do + echo Trying $TGT $URL $REV >&2 + getsha256 $URL $REV >> $OUT || exit 1 +done + +echo ']' >> $OUT + diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 0aad3947f0f1..6d4af1c6a015 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -2735,6 +2735,8 @@ let openmpi = callPackage ../development/libraries/openmpi { }; + openmodelica = callPackage ../applications/science/misc/openmodelica { }; + qarte = callPackage ../applications/video/qarte { sip = pythonPackages.sip_4_16; };