Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ env:

jobs:
macos:
runs-on: macos-11
runs-on: macos-15
steps:
- name: asdf cache
uses: actions/cache@v3
id: asdf-cache
with:
path: /Users/runner/.asdf
key: macos-otp-${{ env.OTP_VERSION }}
key: macos-15-otp-${{ env.OTP_VERSION }}

- name: "Installing Erlang"
if: steps.asdf-cache.outputs.cache-hit != 'true'
Expand All @@ -34,7 +34,7 @@ jobs:
uses: actions/cache/save@v3
with:
path: /Users/runner/.asdf
key: macos-otp-${{ env.OTP_VERSION }}
key: macos-15-otp-${{ env.OTP_VERSION }}

- uses: actions/checkout@v3
- name: "Create keychain"
Expand Down
20 changes: 12 additions & 8 deletions lib/package/linux.ex
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,7 @@ defmodule Desktop.Deployment.Package.Linux do
files = wildcard(Path.dirname(libwebkit), "#{basename}/*")

for file <- files do
if File.dir?(file) do
File.mkdir_p!(Path.join([priv(pkg), "libwebkit2gtk", Path.basename(file)]))

for subfile <- wildcard(file, "*"),
do: priv_import!(pkg, subfile, extra_path: ["libwebkit2gtk/#{Path.basename(file)}"])
else
priv_import!(pkg, file, extra_path: ["libwebkit2gtk"])
end
import_webkit_entry(pkg, file)
end

redirection =
Expand All @@ -99,6 +92,17 @@ defmodule Desktop.Deployment.Package.Linux do
end
end

defp import_webkit_entry(%Package{} = pkg, file) do
if File.dir?(file) do
File.mkdir_p!(Path.join([priv(pkg), "libwebkit2gtk", Path.basename(file)]))

for subfile <- wildcard(file, "*"),
do: priv_import!(pkg, subfile, extra_path: ["libwebkit2gtk/#{Path.basename(file)}"])
else
priv_import!(pkg, file, extra_path: ["libwebkit2gtk"])
end
end

defp import_libgstreamer_modules(%Package{} = pkg, deps) do
libgst =
Enum.find(deps, fn lib -> String.starts_with?(Path.basename(lib), "libgstreamer") end)
Expand Down
14 changes: 7 additions & 7 deletions lib/package/macos.ex
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,7 @@ defmodule Desktop.Deployment.Package.MacOS do
end

for bin <- find_binaries(root) do
rewrite_deps(bin, fn dep ->
if should_rewrite?(bin, dep) do
rewrite_to_approot(pkg, bin, dep, root)
end
end)
rewrite_deps(bin, &maybe_rewrite_dep_to_approot(pkg, bin, &1, root))
end

developer_id = find_developer_id()
Expand Down Expand Up @@ -327,6 +323,10 @@ defmodule Desktop.Deployment.Package.MacOS do
))
end

defp maybe_rewrite_dep_to_approot(pkg, bin, dep, root) do
if should_rewrite?(bin, dep), do: rewrite_to_approot(pkg, bin, dep, root)
end

defp rewrite_to_approot(pkg, bin, dep, root) do
location =
if String.contains?(dep, ".framework/") do
Expand Down Expand Up @@ -373,9 +373,9 @@ defmodule Desktop.Deployment.Package.MacOS do
@friendly_attribute {2, 5, 4, 3}
def locate_uid(pem_filename) do
cert = File.read!(pem_filename)
# Test for missing public_key application
# Ensure :public_key is started (see extra_applications in mix.exs)
# ref https://elixirforum.com/t/nerves-key-hub-mix-tasks-fail-because-of-missing-pubkey-pem-module/62821/2
Mix.ensure_application!(:public_key)
Application.ensure_all_started(:public_key)
cert_der = List.keyfind!(:public_key.pem_decode(cert), :Certificate, 0)

:public_key.der_decode(:Certificate, elem(cert_der, 1))
Expand Down
Loading