Skip to content

Commit

Permalink
vapoursynth: include required def files in repo
Browse files Browse the repository at this point in the history
Instead relying dlls from tarball to generate def file, including
VapourSynth.def and VSScript.def is wise choice since the public
API doesnt change.
  • Loading branch information
shinchiro committed Mar 19, 2024
1 parent ca13aae commit 4441589
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 10 deletions.
27 changes: 27 additions & 0 deletions packages/VSScript.def
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
;
; Definition file of VSScript.dll
; Automatic generated by gendef
; written by Kai Tietz 2008
;
LIBRARY "VSScript.dll"
EXPORTS
getVSScriptAPI@4
vsscript_clearEnvironment@4
vsscript_clearOutput@8
vsscript_clearVariable@8
vsscript_createScript@4
vsscript_evaluateFile@12
vsscript_evaluateScript@16
vsscript_finalize@0
vsscript_freeScript@4
vsscript_getApiVersion@0
vsscript_getCore@4
vsscript_getError@4
vsscript_getExitCode@4
vsscript_getOutput2@12
vsscript_getOutput@8
vsscript_getVSApi2@4
vsscript_getVSApi@0
vsscript_getVariable@12
vsscript_init@0
vsscript_setVariable@8
8 changes: 8 additions & 0 deletions packages/VapourSynth.def
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
;
; Definition file of VapourSynth.dll
; Automatic generated by gendef
; written by Kai Tietz 2008
;
LIBRARY "VapourSynth.dll"
EXPORTS
getVapourSynthAPI@4
18 changes: 8 additions & 10 deletions packages/vapoursynth.cmake
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
if(${TARGET_CPU} MATCHES "x86_64")
set(rev "R65")
set(link "https://github.com/vapoursynth/vapoursynth/releases/download/${rev}/VapourSynth64-Portable-${rev}.7z")
set(hash "E3FCA973DC56283289A2F4F73FE0A6908FF270B9C46B65AF3F8674BE867CA303")
else()
set(rev "R63")
set(link "https://github.com/vapoursynth/vapoursynth/releases/download/${rev}/VapourSynth32-Portable-${rev}.7z")
set(hash "88057C6BD25D42CCCCDE94305AF340B95BFCA7EA2D9BB57A544B2621A60F563F")
set(dlltool_opts "-U")
endif()

Expand All @@ -15,12 +11,12 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/vapoursynth-script.pc.in ${CMAKE_CURR
set(GENERATE_DEF ${CMAKE_CURRENT_BINARY_DIR}/vapoursynth-prefix/src/generate_def.sh)
file(WRITE ${GENERATE_DEF}
"#!/bin/bash
gendef - $1.dll | sed -r -e 's|^_||' -e 's|@[1-9]+$||' > $1.def")
if [[ \"$1\" != \"i686\" ]]; then
sed -r -e 's|@[0-9]+$||' -i $2
fi")

ExternalProject_Add(vapoursynth
URL ${link}
URL_HASH SHA256=${hash}
DOWNLOAD_DIR ${SOURCE_LOCATION}
DOWNLOAD_COMMAND ""
UPDATE_COMMAND ""
PATCH_COMMAND ""
CONFIGURE_COMMAND ""
Expand All @@ -32,9 +28,11 @@ ExternalProject_Add(vapoursynth
ExternalProject_Add_Step(vapoursynth generate-def
DEPENDEES install
WORKING_DIRECTORY <SOURCE_DIR>
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/VapourSynth.def <SOURCE_DIR>/VapourSynth.def
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/VSScript.def <SOURCE_DIR>/VSScript.def
COMMAND chmod 755 ${GENERATE_DEF}
COMMAND ${EXEC} ${GENERATE_DEF} VSScript
COMMAND ${EXEC} ${GENERATE_DEF} VapourSynth
COMMAND ${EXEC} ${GENERATE_DEF} ${TARGET_CPU} VapourSynth.def
COMMAND ${EXEC} ${GENERATE_DEF} ${TARGET_CPU} VSScript.def
LOG 1
)

Expand Down

0 comments on commit 4441589

Please sign in to comment.