github.com/pojntfx/hydrapp/hydrapp@v0.0.0-20240516002902-d08759d6ca9f/pkg/renderers/deb/rules (about)

     1  #!/usr/bin/make -f
     2  SIZES ?= 16x16 22x22 24x24 32x32 36x36 48x48 64x64 72x72 96x96 128x128 192x192 256x256 512x512 1024x1024
     3  
     4  export HOME = $(CURDIR)
     5  
     6  %:
     7  	dh $@
     8  
     9  override_dh_auto_test:
    10  	DEB_BUILD_OPTIONS=nocheck dh_auto_test
    11  
    12  override_dh_auto_build:
    13  	GOPROXY='https://proxy.golang.org,direct' GOFLAGS="{{ .GoFlags }}" sh -c '{{ .GoGenerate }}'
    14  	GOPROXY='https://proxy.golang.org,direct' GOFLAGS="{{ .GoFlags }}" CGO_ENABLED=1 go build -ldflags='-compressdwarf=false' -o out/{{ .AppID }} {{ .GoMain }}
    15  	for icon in 16x16 22x22 24x24 32x32 36x36 48x48 64x64 72x72 96x96 128x128 192x192 256x256 512x512; do cp "{{ .GoMain }}/icon-$${icon}.png" out/icon-$${icon}.png; done
    16  
    17  override_dh_auto_install:
    18  	install -D out/{{ .AppID }} $$(pwd)/debian/{{ .AppID }}/usr/bin/{{ .AppID }}
    19  	desktop-file-install --dir=$$(pwd)/debian/{{ .AppID }}/usr/share/applications {{ .GoMain }}/{{ .AppID }}.desktop
    20  	appstream-util validate-relax {{ .GoMain }}/{{ .AppID }}.metainfo.xml
    21  	for icon in 16x16 22x22 24x24 32x32 36x36 48x48 64x64 72x72 96x96 128x128 192x192 256x256 512x512; do install -D -m 0644 out/icon-$${icon}.png $$(pwd)/debian/{{ .AppID }}/usr/share/icons/hicolor/$${icon}/apps/{{ .AppID }}.png; done
    22  	install -D -m 0644 {{ .GoMain }}/{{ .AppID }}.metainfo.xml $$(pwd)/debian/{{ .AppID }}/usr/share/metainfo/{{ .AppID }}.metainfo.xml