package.nix (2050B)
1 { 2 lib, 3 stdenv, 4 fetchurl, 5 6 bison, 7 gettext, 8 pkg-config, 9 10 firebird, 11 gd, 12 libmysqlclient, 13 libpq, 14 libz, 15 net-snmp, 16 pcre, 17 portaudio, 18 qt6, 19 sqlite, 20 21 withFireBird ? false, 22 withMySQL ? false, 23 withPostgreSQL ? false, 24 withSNMP ? false, 25 withSoundCard ? false, 26 withSiemens ? stdenv.hostPlatform.isLinux, 27 }: 28 29 stdenv.mkDerivation (finalAttrs: { 30 pname = "openscada"; 31 version = "0.9.8"; 32 33 __structuredAttrs = true; 34 35 main_src = fetchurl { 36 url = "http://oscada.org/oscadaArch/0.9/openscada-${finalAttrs.version}.tar.xz"; 37 hash = "sha256-UuDdURwu/hL/b3sykumLbHZXMzLh8/qmKqEsBRcaZew="; 38 }; 39 40 res_src = fetchurl { 41 url = "http://oscada.org/oscadaArch/0.9/openscada-res-${finalAttrs.version}.tar.xz"; 42 hash = "sha256-qVCmklGt9UKGFC1iiSy9+4kqfScfNIoiJeXX60bjJr0="; 43 }; 44 45 srcs = [ 46 finalAttrs.main_src 47 finalAttrs.res_src 48 ]; 49 50 sourceRoot = "openscada-${finalAttrs.version}"; 51 52 postPatch = '' 53 mv ../data ../doc . 54 ''; 55 56 nativeBuildInputs = [ 57 bison 58 gettext 59 pkg-config 60 qt6.wrapQtAppsHook 61 ]; 62 63 buildInputs = [ 64 gd 65 libz 66 pcre 67 qt6.qtbase 68 sqlite 69 ] 70 ++ lib.optional withFireBird firebird 71 ++ lib.optional withMySQL libmysqlclient 72 ++ lib.optional withPostgreSQL libpq 73 ++ lib.optional withSNMP net-snmp 74 ++ lib.optional withSoundCard portaudio; 75 76 configureFlags = [ 77 (lib.enableFeature withFireBird "FireBird") 78 (lib.withFeatureAs withFireBird "firebird" firebird) 79 (lib.enableFeature withMySQL "MySQL") 80 (lib.enableFeature withPostgreSQL "PostgreSQL") 81 (lib.enableFeature withSNMP "SNMP") 82 (lib.enableFeature withSoundCard "SoundCard") 83 (lib.enableFeature withSiemens "Siemens") 84 ]; 85 86 enableParallelBuilding = true; 87 88 env.NIX_CFLAGS_COMPILE = "-Wno-error=implicit-function-declaration"; 89 90 meta = { 91 description = "Open SCADA system"; 92 homepage = "http://oscada.org"; 93 license = lib.licenses.gpl2Only; 94 maintainers = [ lib.maintainers.sikmir ]; 95 platforms = lib.platforms.unix; 96 mainProgram = "openscada"; 97 }; 98 })
