nur-packages

My NUR packages
git clone git://git.sikmir.ru/nur-packages
Log | Files | Refs | README | LICENSE

package.nix (1260B)


      1 {
      2   lib,
      3   stdenv,
      4   fetchFromGitHub,
      5   qt5,
      6   qmqtt,
      7 }:
      8 
      9 stdenv.mkDerivation (finalAttrs: {
     10   pname = "mqtt-load-simulator";
     11   version = "1.5.1";
     12 
     13   src = fetchFromGitHub {
     14     owner = "halfgaar";
     15     repo = "MqttLoadSimulator";
     16     tag = "v${finalAttrs.version}";
     17     hash = "sha256-XXU5ghCD2rRrZArVzi97oZukCWYGgpXLNhUAztFeyjw=";
     18   };
     19 
     20   postPatch = ''
     21     sed -i "23i typedef unsigned int uint;" clientnumberpool.h
     22     substituteInPlace MqttLoadSimulator.pro \
     23       --replace-fail "QT += network qmqtt" "QT += network" \
     24       --replace-fail "/opt" "$out"
     25     cat >> MqttLoadSimulator.pro <<"EOF"
     26     LIBS += -L${qmqtt}/lib -lqmqtt
     27     EOF
     28   '';
     29 
     30   sourceRoot = "${finalAttrs.src.name}/MqttLoadSimulator";
     31 
     32   nativeBuildInputs = [
     33     qt5.qmake
     34     qt5.wrapQtAppsHook
     35   ];
     36 
     37   buildInputs = [ (qmqtt.override { qt6 = qt5; }) ];
     38 
     39   postInstall = ''
     40     mv $out/MqttLoadSimulator/* $out
     41     rm -r $out/MqttLoadSimulator
     42   '';
     43 
     44   meta = {
     45     description = "Simulate MQTT load / MQTT stress tester";
     46     homepage = "https://github.com/halfgaar/MqttLoadSimulator";
     47     license = lib.licenses.gpl2Only;
     48     maintainers = [ lib.maintainers.sikmir ];
     49     platforms = lib.platforms.unix;
     50     mainProgram = "MqttLoadSimulator";
     51     broken = stdenv.isDarwin;
     52   };
     53 })