From 21fb9b93ea460d664a2ea01a824279af73cbd912 Mon Sep 17 00:00:00 2001 From: Ivan Mahonin Date: Apr 07 2017 09:28:45 +0000 Subject: Fix synfigstudio-nsis --- diff --git a/docker-builder-data/build/script/packet/synfigcore-master.sh b/docker-builder-data/build/script/packet/synfigcore-master.sh index 01713f7..7b592a9 100644 --- a/docker-builder-data/build/script/packet/synfigcore-master.sh +++ b/docker-builder-data/build/script/packet/synfigcore-master.sh @@ -104,7 +104,4 @@ pkinstall() { if ! make install; then return 1 fi - - # add examples - cp -r "$BUILD_PACKET_DIR/$PK_DIRNAME/synfig-core/examples" "$INSTALL_PACKET_DIR/share/synfig/" || return 1 } diff --git a/docker-builder-data/build/script/packet/synfigstudio-master.sh b/docker-builder-data/build/script/packet/synfigstudio-master.sh index 9807bdb..36829dd 100644 --- a/docker-builder-data/build/script/packet/synfigstudio-master.sh +++ b/docker-builder-data/build/script/packet/synfigstudio-master.sh @@ -73,6 +73,9 @@ pkinstall() { cp "$FILES_PACKET_DIR/loaders.cache" "lib/gdk-pixbuf-2.0/2.10.0/" || return 1 fi + # add examples + cp -r "$BUILD_PACKET_DIR/$PK_DIRNAME/synfig-core/examples" "$INSTALL_PACKET_DIR/share/synfig/" || return 1 + # copy system libraries if [ "$PLATFORM" = "win" ]; then local TARGET="$INSTALL_PACKET_DIR/bin/" diff --git a/docker-builder-data/build/script/packet/synfigstudio-nsis.files/synfigstudio.nsi b/docker-builder-data/build/script/packet/synfigstudio-nsis.files/synfigstudio.nsi index 5beaf7d..dcd8d6b 100644 --- a/docker-builder-data/build/script/packet/synfigstudio-nsis.files/synfigstudio.nsi +++ b/docker-builder-data/build/script/packet/synfigstudio-nsis.files/synfigstudio.nsi @@ -7,12 +7,14 @@ ; files-stuff-uninstall.nsh ; Defines which will set by 'config.nsh': -; PK_NAME - XxxxxXxxxx - name without spaces -; PK_NAME_FULL - Xxxxx Xxxxxxxxxx - full name, may be with spaces -; PK_ARCH - XX - architecture, 32 or 64 -; PK_VERSION - X.X - first two numbers of version -; PK_VERSION_FULL - X.X.X-xxxxx-xxxxx - full version, without spaces -; PK_EXECUTABLE - xxx\XxxxXxxx-xxx_xxx.exe - subpath to executable file +; PK_NAME - XxxxxXxxxx - name without spaces +; PK_NAME_FULL - Xxxxx Xxxxxxxxxx - full name, may be with spaces +; PK_ARCH - XX - architecture, 32 or 64 +; PK_VERSION - X.X - first two numbers of version +; PK_VERSION_FULL - X.X.X-xxxxx-xxxxx - full version, without spaces +; PK_EXECUTABLE - xxx\XxxxXxxx-xxx_xxx.exe - subpath to executable file +; PK_ICON - xxx\XxxxXxxx-xxx_xxx.ico - subpath to icon file (may be *.exe) +; PK_DOCUMENT_ICON - xxx\XxxxXxxx-xxx_xxx.ico - subpath to icon file for associated documents !include "config.nsh" @@ -94,9 +96,9 @@ Section "${PK_NAME_FULL} (required)" WriteRegStr HKCR ".sfg" "PerceivedType" "image" WriteRegStr HKCR "Synfig.Composition" "" "Synfig Composition File" - WriteRegStr HKCR "Synfig.Composition\DefaultIcon" "" "$INSTDIR\share\pixmaps\sif_icon.ico" + WriteRegStr HKCR "Synfig.Composition\DefaultIcon" "" "$INSTDIR\${PK_DOCUMENT_ICON}" WriteRegStr HKCR "Synfig.Composition\shell" "" "open" - WriteRegStr HKCR "Synfig.Composition\shell\open\command" "" '$INSTDIR\bin\synfigstudio.exe "%1"' + WriteRegStr HKCR "Synfig.Composition\shell\open\command" "" '$INSTDIR\${PK_EXECUTABLE} "%1"' System::Call 'Shell32::SHChangeNotify(i ${SHCNE_ASSOCCHANGED}, i ${SHCNF_IDLIST}, i 0, i 0)' @@ -125,7 +127,7 @@ Section "Start Menu Shortcuts" SetShellVarContext All CreateDirectory "$SMPROGRAMS\${PK_NAME_FULL}" CreateShortCut "$SMPROGRAMS\${PK_NAME_FULL}\Uninstall ${PK_NAME_FULL}.lnk" "$INSTDIR\uninstall-${PK_NAME}.exe" "" "$INSTDIR\uninstall-${PK_NAME}.exe" 0 - CreateShortCut "$SMPROGRAMS\${PK_NAME_FULL}\${PK_NAME_FULL}.lnk" "$INSTDIR\${PK_EXECUTABLE}" "" "$INSTDIR\${PK_EXECUTABLE}" 0 + CreateShortCut "$SMPROGRAMS\${PK_NAME_FULL}\${PK_NAME_FULL}.lnk" "$INSTDIR\${PK_EXECUTABLE}" "" "$INSTDIR\${PK_ICON}" 0 SectionEnd ;-------------------------------- @@ -136,7 +138,6 @@ Section "Uninstall" SetRegView ${PK_ARCH} ReadRegStr $INSTDIR HKLM "${PRODUCT_REG_KEY}" "Path" - ReadRegStr $STUFFDIR HKLM "${PRODUCT_REG_KEY}\${PK_NAME}\${PK_VERSION}" "TOONZROOT" ; Remove registry keys DeleteRegKey HKCR "Synfig.Composition\shell\open\command" diff --git a/docker-builder-data/build/script/packet/synfigstudio-nsis.sh b/docker-builder-data/build/script/packet/synfigstudio-nsis.sh index d5d02d9..6d2338a 100644 --- a/docker-builder-data/build/script/packet/synfigstudio-nsis.sh +++ b/docker-builder-data/build/script/packet/synfigstudio-nsis.sh @@ -1,5 +1,10 @@ DEPS="synfigstudio-master" +PK_PYTHON_DIRNAME="python" +PK_PYTHON_ARCHIVE="portable-python-3.2.5.1.zip" +PK_PYTHON_URL="https://download.tuxfamily.org/synfig/packages/sources/$PK_PYTHON_ARCHIVE" + + pkfunc_register_file() { local FILE=$1 local WIN_FILE=$(echo "$FILE" | sed "s|\/|\\\\|g") @@ -29,6 +34,19 @@ pkfunc_register_file() { fi } +# download portable python and pass downloaded files through all build phases +pkdownload() { + wget -c --no-check-certificate "$PK_PYTHON_URL" -O "$PK_PYTHON_ARCHIVE" || return 1 +} + +pkunpack() { + unzip "$DOWNLOAD_PACKET_DIR/$PK_PYTHON_ARCHIVE" || return 1 +} + +pkinstall() { + copy "$BUILD_PACKET_DIR" "$INSTALL_PACKET_DIR" || return 1 +} + pkinstall_release() { local LOCAL_INSTALLER_DIR="$INSTALL_RELEASE_PACKET_DIR/installer" local LOCAL_CACHE_DIR="$INSTALL_RELEASE_PACKET_DIR/cache" @@ -42,17 +60,10 @@ pkinstall_release() { copy "$ENVDEPS_RELEASE_PACKET_DIR" "./" || return 1 # move examples - mv "./share/synfig/examples" "./" - - # download portable python - mkdir -p "$LOCAL_CACHE_DIR" - cd "$LOCAL_CACHE_DIR" || return 1 - wget -c --no-check-certificate \ - "https://download.tuxfamily.org/synfig/packages/sources/portable-python-3.2.5.1.zip" \ - -O "portable-python-3.2.5.1.zip" || return 1 - rm -rf "python" - unzip "portable-python-3.2.5.1.zip" || return 1 - mv "python" "$LOCAL_INSTALLER_DIR/" || return 1 + mv "./share/synfig/examples" "./" || return 1 + + # add portable python + copy "$INSTALL_PACKET_DIR/$PK_PYTHON_DIRNAME" "$LOCAL_INSTALLER_DIR/python" || return 1 cd "$LOCAL_INSTALLER_DIR" || return 1 # get version @@ -75,12 +86,14 @@ pkinstall_release() { # create config.nsh (see opentoons.nsi) cat > config.nsh << EOF -!define PK_NAME "synfigstudio" -!define PK_NAME_FULL "Synfig Studio" -!define PK_ARCH "$ARCH" -!define PK_VERSION "${LOCAL_VERSION2}" -!define PK_VERSION_FULL "${LOCAL_VERSION}-${LOCAL_COMMIT:0:5}" -!define PK_EXECUTABLE "bin\\synfigstudio.exe" +!define PK_NAME "synfigstudio" +!define PK_NAME_FULL "Synfig Studio" +!define PK_ARCH "$ARCH" +!define PK_VERSION "${LOCAL_VERSION2}" +!define PK_VERSION_FULL "${LOCAL_VERSION}-${LOCAL_COMMIT:0:5}" +!define PK_EXECUTABLE "bin\\synfigstudio.exe" +!define PK_ICON "share\\pixmaps\\synfig_icon.ico" +!define PK_DOCUMENT_ICON "share\\pixmaps\\sif_icon.ico" EOF # let's go