Skip to content

v0.3.0

Latest

Choose a tag to compare

@github-actions github-actions released this 20 Oct 14:15
· 2 commits to main since this release
cb469ba

Nativella runs a Symfony, Laravel or plain PHP app as a desktop app, with PHP inside the app process.

What's new since 0.2

  • iOS apps without Xcode (experimental). nativella ios makes the iOS app of a project from a template app of this release, on any computer, without Xcode nor a Mac:

    # For the simulator
    nativella ios path/to/project --template nativella-ios-template-iphonesimulator-arm64.zip -o dist/notes.app
    
    # For devices: an IPA, signed with your certificate (its password in NATIVELLA_CERTIFICATE_PASSWORD)
    nativella ios path/to/project --template nativella-ios-template-iphoneos-arm64.zip \
        --certificate ios.p12 --profile notes.mobileprovision -o dist/notes.ipa

    The CI makes the app of the Symfony demo on Linux and opens it in the simulator, where PHP answers. No IPA has run on a device yet: if you try one, tell what the device says in an issue. The icon of the project does not reach iOS apps yet. See Mobile.

  • Phones get the PHP of the desktop. Android and iOS apps used NativePHP's prebuilt PHP. Nativella now builds its own, from the same sources and with the same extensions as the desktop, intl included. ICU and its data add about 36 MB, as on the desktop: the template APK about doubles. See PHP for the phone.

  • Android apps get the icon of their project. nativella android makes the icon of the project the launcher icon, drawn for each screen density. Without one, the APK gets the Nativella icon, no longer Tauri's logo. No adaptive icon yet.

  • Third-party notices. Every executable, APK and iOS app carries the licenses of the software it contains: PHP, its libraries, the Rust crates and, on Android, the Java libraries. nativella licenses prints them, nativella build writes THIRD_PARTY_NOTICES.txt next to the executable, and App::thirdPartyNotices() returns them, for an "about" page. Distribute them with your app, with the licenses of your own dependencies. The static PHP links LGPL code (GNU libiconv, libbcmath, libmbfl): the notices give the version and the source archive of each. See Licenses.

  • Linux, distribution by distribution. Installation lists the packages of WebKitGTK 4.1 and of the tray for Ubuntu, Debian, Fedora, the RHEL 10 family and Arch. The users of your app need them too. The RHEL 9 family, with glibc 2.34, cannot run the releases.

Under the hood

  • static-php-cli builds no PHP for phones: castor static-php:android and castor static-php:ios cross compile PHP and its libraries from its downloads, with the extension list of the desktop. PHP runs without JIT on phones. From the repository, --abi=x86_64 builds Android apps for the emulators of x86_64 computers; the release has arm64 only.
  • cargo-about gathers the licenses of the Rust crates: a crate under a license that tools/cargo-about/about.toml does not list fails the build.
  • CI: only main saves the caches, as those of pull requests filled the 10 GB and evicted them; pull requests no longer build the release executables, main does; the Linux jobs run on Ubuntu 26.04.
  • sha2 0.11.1.

Upgrading from 0.2

Require the packages with ^0.3: before 1.0, ^0.2 does not accept 0.3. With Symfony, for example:

composer require nativella/nativella:^0.3 nativella/symfony-bundle:^0.3

With Laravel, nativella/laravel:^0.3. Take the nativella command and the templates from the same release.

  • nativella bundle is gone: nativella ios makes iOS apps from a template instead.
  • PHP on phones no longer has sockets nor the mb_ereg* functions, which NativePHP's had and the desktop's does not. It gains intl and zip.
  • nativella android now reads the icon of the project: it fails when the file is missing or is not a PNG.

Try it

Download the Symfony demo for your platform below, nativella-demo-symfony-linux-x86_64 or nativella-demo-symfony-macos-aarch64: one executable, PHP inside. Make it executable with chmod +x <file>, then run it.

  • On Linux, it needs glibc 2.35 or later and the system webview, WebKitGTK 4.1: sudo apt install libwebkit2gtk-4.1-0, sudo dnf install webkit2gtk4.1 or sudo pacman -S webkit2gtk-4.1 (see Installation for the other distributions).
  • On macOS, the executable is not signed: xattr -d com.apple.quarantine <file> after downloading it with a browser.

Then read Getting started to run your own app. Nativella is experimental: read Limitations and roadmap first.

Files

nativella-<platform> runs a PHP project (nativella run <project-dir>)
and builds standalone applications (nativella build);
nativella-demo-*-<platform> are the demos, as standalone applications.
SHA256SUMS-<platform> holds their checksums.

THIRD_PARTY_NOTICES-<platform>.txt holds the licenses of the software they
contain: PHP, its libraries, the Rust crates and, on Android, the Java
libraries. nativella licenses prints them, nativella build writes them
next to the applications it builds, and the APKs and the iOS apps carry
them: distribute them with your applications.

They are linked against a static PHP 8.5: they need no PHP on the machine.

Linux x86_64: glibc 2.35 or later (Ubuntu 22.04, Debian 12, Fedora,
RHEL 10, Arch…), and the webview of the system, WebKitGTK 4.1, to run:
sudo apt install libwebkit2gtk-4.1-0, sudo dnf install webkit2gtk4.1
or sudo pacman -S webkit2gtk-4.1. An application with a tray icon needs
the library of the tray too. The packages of each distribution:
https://lyrixx.github.io/nativella/docs/installation/#linux-x86_64

macOS arm64: they need nothing installed. They are not signed: downloaded
with a browser, remove the quarantine first, with
xattr -d com.apple.quarantine <file>.

Android arm64: nativella android <project-dir> --template nativella-android-template-arm64.apk makes the APK of a PHP project of
this template, with the nativella command of the same release.

iOS arm64, experimental: nativella ios <project-dir> --template nativella-ios-template-iphonesimulator-arm64.zip makes an app of a PHP
project for the simulator; with nativella-ios-template-iphoneos-arm64.zip,
--certificate and --profile, an IPA for devices, which no device has
run yet.