Skip to content

Commit

Permalink
fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
remi durand committed Apr 14, 2021
1 parent 39c95d7 commit 1c29b7f
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 31 deletions.
11 changes: 8 additions & 3 deletions .github/workflows/ccpp_mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,12 @@ jobs:
run: cmake .. -DCMAKE_PREFIX_PATH="$PWD/../deps/build/destdir/usr/local" -DCMAKE_OSX_DEPLOYMENT_TARGET="10.13" -DSLIC3R_STATIC=1
- name: make SuperSlicer
working-directory: ./build
run: make SuperSlicer
run: make Slic3r
- name: ls build
working-directory: ./build
run: |
ls -al src
ls -al .
- name: update Info.plist
working-directory: ./build/src
run: sed "s/+UNKNOWN/_$(date '+%F')/" Info.plist >Info.date.plist
Expand All @@ -66,15 +71,15 @@ jobs:
working-directory: ./build
run: |
cp -Rf ../resources pack/SuperSlicer/SuperSlicer.app/Contents/Resources
cp pack/SuperSlicer/SuperSlicer.app/Contents/Resources/icons/slic3r.icns pack/SuperSlicer/SuperSlicer.app/Contents/resources/Slic3r.icns
cp pack/SuperSlicer/SuperSlicer.app/Contents/Resources/icons/SuperSlicer.icns pack/SuperSlicer/SuperSlicer.app/Contents/resources/SuperSlicer.icns
cp src/Info.date.plist pack/SuperSlicer/SuperSlicer.app/Contents/Info.plist
echo -n -e 'APPL????\x0a' > PkgInfo
cp PkgInfo pack/SuperSlicer/SuperSlicer.app/Contents/PkgInfo
# echo -n -e '\xff\xfeAPPL\x3f\x00\x3f\x00\x3f\x00\x3f\x00\x0a\x00' > PkgInfo
- name: copy bin and do not let it lower case
working-directory: ./build
run: |
cp -f src/SuperSlicer pack/SuperSlicer/SuperSlicer.app/Contents/MacOS/SuperSlicer
cp -f src/superslicer pack/SuperSlicer/SuperSlicer.app/Contents/MacOS/SuperSlicer
chmod u+x pack/SuperSlicer/SuperSlicer.app/Contents/MacOS/SuperSlicer
tar -cvf SuperSlicer.tar pack/SuperSlicer
- name: create dmg
Expand Down
11 changes: 8 additions & 3 deletions .github/workflows/ccpp_ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
run: cmake .. -DCMAKE_PREFIX_PATH="/home/runner/work/SuperSlicer/SuperSlicer/deps/build/destdir/usr/local" -DSLIC3R_STATIC=1
- name: make SuperSlicer
working-directory: ./build
run: make SuperSlicer
run: make Slic3r
- name: create directory and copy into it
working-directory: ./build
run: |
Expand All @@ -58,6 +58,11 @@ jobs:
- name: copy resources
working-directory: ./build
run: cp -Rf ../resources package/resources
- name: ls build
working-directory: ./build
run: |
ls -al src
ls -al .
- name: copy bin
working-directory: ./build
run: cp -f src/superslicer package/bin/superslicer
Expand All @@ -75,8 +80,8 @@ jobs:
- name: build appimage
working-directory: ./build/package
run: |
chmod +x ../../src/platform/unix/build_appimage.sh
../../src/platform/unix/build_appimage.sh SuperSlicer_ubu64.AppImage
chmod +x ../build_appimage.sh
../build_appimage.sh
- name: Upload appimage
uses: actions/[email protected]
with:
Expand Down
39 changes: 22 additions & 17 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -514,21 +514,26 @@ if(SLIC3R_BUILD_TESTS)
add_subdirectory(tests)
endif()

if (NOT WIN32 AND NOT APPLE)
configure_file(${LIBDIR}/platform/unix/build_appimage.sh.in ${CMAKE_CURRENT_BINARY_DIR}/build_appimage.sh @ONLY)
endif()

# Resources install target, configure fhs.hpp on UNIX
if (WIN32)
install(DIRECTORY "${SLIC3R_RESOURCES_DIR}/" DESTINATION "${CMAKE_INSTALL_PREFIX}/resources")
elseif (SLIC3R_FHS)
# CMAKE_INSTALL_FULL_DATAROOTDIR: read-only architecture-independent data root (share)
set(SLIC3R_FHS_RESOURCES "${CMAKE_INSTALL_FULL_DATAROOTDIR}/Slic3r")
set(SLIC3R_FHS_RESOURCES "${CMAKE_INSTALL_FULL_DATAROOTDIR}/${SLIC3R_APP_KEY}")
install(DIRECTORY "${SLIC3R_RESOURCES_DIR}/" DESTINATION "${SLIC3R_FHS_RESOURCES}")
install(FILES src/platform/unix/Slic3r.desktop DESTINATION ${CMAKE_INSTALL_FULL_DATAROOTDIR}/applications)
install(FILES src/platform/unix/Gcodeviewer.desktop DESTINATION ${CMAKE_INSTALL_FULL_DATAROOTDIR}/applications)
install(FILES resources/icons/Slic3r_192px.png DESTINATION ${CMAKE_INSTALL_FULL_DATAROOTDIR}/pixmaps RENAME Slic3r.png)
install(FILES resources/icons/PrusaSlicer-gcodeviewer_192px.png DESTINATION ${CMAKE_INSTALL_FULL_DATAROOTDIR}/pixmaps RENAME Slic3r-gcodeviewer.png)
configure_file(${LIBDIR}/platform/unix/Slic3r.desktop.in ${LIBDIR_BIN}/${SLIC3R_APP_KEY}.desktop @ONLY)
configure_file(${LIBDIR}/platform/unix/Gcodeviewer.desktop.in ${LIBDIR_BIN}/${SLIC3R_APP_KEY}-Gcodeviewer.desktop @ONLY)
install(FILES ${LIBDIR_BIN}/${SLIC3R_APP_KEY}.desktop DESTINATION ${CMAKE_INSTALL_FULL_DATAROOTDIR}/applications)
install(FILES ${LIBDIR_BIN}/${SLIC3R_APP_KEY}-Gcodeviewer.desktop DESTINATION ${CMAKE_INSTALL_FULL_DATAROOTDIR}/applications)
install(FILES resources/icons/${SLIC3R_APP_KEY}_192px.png DESTINATION ${CMAKE_INSTALL_FULL_DATAROOTDIR}/pixmaps RENAME ${SLIC3R_APP_KEY}.png)
install(FILES resources/icons/${SLIC3R_APP_KEY}-gcodeviewer_192px.png DESTINATION ${CMAKE_INSTALL_FULL_DATAROOTDIR}/pixmaps RENAME ${SLIC3R_APP_KEY}-gcodeviewer.png)
else ()
install(FILES src/platform/unix/Slic3r.desktop DESTINATION ${CMAKE_INSTALL_PREFIX}/resources/applications)
install(FILES src/platform/unix/Gcodeviewer.desktop DESTINATION ${CMAKE_INSTALL_PREFIX}/resources/applications)
install(FILES ${LIBDIR}/platform/unix/Slic3r.desktop DESTINATION ${CMAKE_INSTALL_PREFIX}/resources/applications)
install(FILES ${LIBDIR}/platform/unix/Gcodeviewer.desktop DESTINATION ${CMAKE_INSTALL_PREFIX}/resources/applications)
install(DIRECTORY "${SLIC3R_RESOURCES_DIR}/" DESTINATION "${CMAKE_INSTALL_PREFIX}/resources")
endif ()

Expand All @@ -537,27 +542,27 @@ configure_file(${LIBDIR}/platform/unix/fhs.hpp.in ${LIBDIR_BIN}/platform/unix/fh
if (WIN32)
else ()
set(CPACK_GENERATOR "STGZ;TGZ;TZ")
set(CPACK_NSIS_DISPLAY_NAME "Slic3r 2.0")
set(CPACK_NSIS_DISPLAY_NAME "${SLIC3R_APP_NAME} ${SLIC3R_VERSION}")
set(CPACK_OUTPUT_CONFIG_FILE "${CMAKE_SOURCE_DIR}/cmake/CPackConfig.cmake")
set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README.md")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "CMake is a build tool")
set(CPACK_PACKAGE_EXECUTABLES "Slic3r")
set(CPACK_PACKAGE_FILE_NAME "slic3r-2.0-Linux-x86_64")
set(CPACK_PACKAGE_INSTALL_DIRECTORY "Slic3r 2.0")
set(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "Slic3r 2.0.0")
set(CPACK_PACKAGE_NAME "Slic3r")
set(CPACK_PACKAGE_VENDOR "Slic3r")
set(CPACK_PACKAGE_VERSION "2.0.0")
set(CPACK_PACKAGE_EXECUTABLES "${SLIC3R_APP_CMD}")
set(CPACK_PACKAGE_FILE_NAME "${SLIC3R_APP_KEY}-${SLIC3R_VERSION}-Linux-x86_64")
set(CPACK_PACKAGE_INSTALL_DIRECTORY "${SLIC3R_APP_KEY} ${SLIC3R_VERSION}")
set(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "${SLIC3R_BUILD_ID}")
set(CPACK_PACKAGE_NAME "${SLIC3R_APP_KEY}")
set(CPACK_PACKAGE_VENDOR "${SLIC3R_APP_NAME}")
set(CPACK_PACKAGE_VERSION "${SLIC3R_VERSION_FULL}")
set(CPACK_PACKAGE_VERSION_MAJOR "2")
set(CPACK_PACKAGE_VERSION_MINOR "0")
set(CPACK_PACKAGE_VERSION_PATCH "0")
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE")
set(CPACK_RESOURCE_FILE_README "${CMAKE_CURRENT_SOURCE_DIR}/README.md")
set(CPACK_RESOURCE_FILE_WELCOME "${CMAKE_CURRENT_SOURCE_DIR}/README.md")
set(CPACK_SOURCE_GENERATOR "TGZ;TZ")
set(CPACK_SOURCE_PACKAGE_FILE_NAME "Slic3r-2.0.0")
set(CPACK_SOURCE_PACKAGE_FILE_NAME "${SLIC3R_APP_KEY}-${SLIC3R_VERSION_FULL}")
set(CPACK_SOURCE_STRIP_FILES "")
set(CPACK_STRIP_FILES "bin/Slic3r")
set(CPACK_STRIP_FILES "bin/${SLIC3R_APP_CMD}")
set(CPACK_SYSTEM_NAME "Linux-x86_64")
set(CPACK_TOPLEVEL_TAG "Linux-x86_64")
endif()
Expand Down
8 changes: 4 additions & 4 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,9 @@ if (MINGW)
set_target_properties(Slic3r PROPERTIES PREFIX "")
endif (MINGW)

if (NOT WIN32 AND NOT APPLE)
if (NOT WIN32)
# Binary name on unix like systems (Linux, Unix)
set_target_properties(Slic3r PROPERTIES OUTPUT_NAME "Slic3r")
set_target_properties(Slic3r PROPERTIES OUTPUT_NAME "${SLIC3R_APP_CMD}")
endif ()

target_link_libraries(Slic3r libslic3r cereal)
Expand Down Expand Up @@ -160,7 +160,7 @@ if (WIN32)
endif()
target_compile_definitions(Slic3r_app_gui PRIVATE -DSLIC3R_WRAPPER_NOCONSOLE)
add_dependencies(Slic3r_app_gui Slic3r)
set_target_properties(Slic3r_app_gui PROPERTIES OUTPUT_NAME "slic3r")
set_target_properties(Slic3r_app_gui PROPERTIES OUTPUT_NAME ${SLIC3R_APP_CMD})
target_link_libraries(Slic3r_app_gui PRIVATE boost_headeronly)

add_executable(Slic3r_app_console PrusaSlicer_app_msvc.cpp ${CMAKE_CURRENT_BINARY_DIR}/${SLIC3R_APP_KEY}.rc)
Expand Down Expand Up @@ -224,7 +224,7 @@ else ()
COMMAND ln -sf Slic3r prusa-gcodeviewer
COMMAND ln -sf Slic3r PrusaGCodeViewer
WORKING_DIRECTORY "$<TARGET_FILE_DIR:Slic3r>"
COMMENT "Symlinking the G-code viewer to Slic3r, symlinking to slic3r and prusa-gcodeviewer"
COMMENT "Symlinking the G-code viewer to Slic3r, symlinking to slic3r and gcodeviewer"
VERBATIM)
else ()
add_custom_command(TARGET Slic3r POST_BUILD
Expand Down
2 changes: 1 addition & 1 deletion src/platform/msw/gcodeviewer.rc.in
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ PRODUCTVERSION @SLIC3R_RC_VERSION@
}
}
2 ICON "@SLIC3R_RESOURCES_DIR@/icons/PrusaSlicer-gcodeviewer.ico"
1 24 "Slic3r.manifest"
1 24 "@SLIC3R_APP_KEY@.manifest"
2 changes: 1 addition & 1 deletion src/platform/unix/Slic3r.desktop.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[Desktop Entry]
Name=@SLIC3R_APP_KEY@
Name=@SLIC3R_APP_NAME@
GenericName=3D Printing Software
Comment=G-code generator for 3D printers
Icon=@SLIC3R_APP_KEY@
Expand Down
4 changes: 2 additions & 2 deletions src/platform/unix/build_appimage.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
APPIMAGETOOLURL="https://github.com/AppImage/AppImageKit/releases/latest/download/appimagetool-x86_64.AppImage"


APP_IMAGE=$1
APP_IMAGE="@SLIC3R_APP_KEY@_@SLIC3R_VERSION_FULL@_ubu64.AppImage"

wget ${APPIMAGETOOLURL} -O ../appimagetool.AppImage
chmod +x ../appimagetool.AppImage
Expand All @@ -24,5 +24,5 @@ EOF


../appimagetool.AppImage .
mv Slic3r-x86_64.AppImage ${APP_IMAGE}
mv @SLIC3R_APP_KEY@-x86_64.AppImage ${APP_IMAGE}
chmod +x ${APP_IMAGE}

2 comments on commit 1c29b7f

@nerdCopter
Copy link

@nerdCopter nerdCopter commented on 1c29b7f Apr 17, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[edit: crap i put this comment in wrong place, but i'll leave it. intended for last master commit history item: https://github.com/supermerill/SuperSlicer/commit/28b8f096b292de0454aea11f8eaacc9f46574cc9 ]

@supermerill

  • local testing shown that it created ./SuperSlicer_2.3.56.0_ubu64.AppImage then upload-artifact does not find build/package/SuperSlicer-x86_64.AppImage
  • a future proof option might be SuperSlicer*.AppImage , but i still could not find it under path: build/package/ nor ./
  • but build time takes so long that i have not tried again.
  • i used find ./ -iname "*.AppImage" in the prior step to find it, i should have also used pwd to find where ./ was

@nerdCopter
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@supermerill
when using
uses: actions/upload-artifact@master
both
path: /home/runner/work/SuperSlicer/SuperSlicer/build/package/SuperSlicer*.AppImage
and
path: build/package/SuperSlicer*.AppImage
seem to work.
ty!

my fork testing:
2021-04-17_17-42

Please sign in to comment.