My personal project and infrastructure archive
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
nomicon/infra/libkookie/nixpkgs/unstable/pkgs/build-support/dotnetbuildhelpers/create-pkg-config-for-dll.sh

23 lines
556 B

#!/usr/bin/env bash
targetDir="$1"
dllFullPath="$2"
dllVersion="$(monodis --assembly "$dllFullPath" | grep ^Version: | cut -f 2 -d : | xargs)"
[ -z "$dllVersion" ] && echo "Defaulting dllVersion to 0.0.0" && dllVersion="0.0.0"
dllFileName="$(basename $dllFullPath)"
dllRootName="$(basename -s .dll $dllFileName)"
targetPcFile="$targetDir"/"$dllRootName".pc
mkdir -p "$targetDir"
cat > $targetPcFile << EOF
Libraries=$dllFullPath
Name: $dllRootName
Description: $dllRootName
Version: $dllVersion
Libs: -r:$dllFileName
EOF
echo "Created $targetPcFile"