Bootstrap recipe for symfony/php-twig

Utkarsh Gupta utkarsh.gupta at canonical.com
Thu Jun 3 07:34:17 UTC 2021


Hi Bryce,

This is awesome, very comprehensive. Whilst following it in the
container, I'm adding the missing bits so the third person can just
follow w/o running into any problems like I did.

On Thu, Jun 3, 2021 at 7:22 AM Bryce Harrington
<bryce.harrington at canonical.com> wrote:
>   - Step 0: Prerequisites
>     + Enable proposed
>     + sudo apt-get remove php*
>
>   - Step 1: Interim php-symfony-contracts
>     dget -x https://snapshot.debian.org/archive/debian/20191114T152956Z/pool/main/p/php-symfony-contracts/php-symfony-contracts_2.0.0-1.dsc
>     cd php-symfony-contracts-2.0.0/
>     install-build-deps
>     DEB_BUILD_OPTIONS=nocheck debuild

Here, you need to ensure you have the right versions of
php-psr-{cache,container}.
sudo apt remove php-psr-cache php-psr-container
sudo apt install php-psr-container=1.0.0-2
sudo apt install php-psr-cache=1.0.1-2

Then the installation below will go smoothly.

>     sudo dpkg -i ../php-symfony-cache-contracts_2.0.0-1_all.deb \
>                  ../php-symfony-translation-contracts_2.0.0-1_all.deb

Make sure to install all the .debs produced, that is, the above two +
other 4, needed in step 2 below because symfony B-D on
php-symfony-contracts. If you don't install now, it'll run into
uninstallability issues. At the very least, you'll need
php-symfony-service-contracts, so at least have that for now.

>   - Step 2: Interim symfony
>     https://snapshot.debian.org/archive/debian/20191225T031557Z/pool/main/s/symfony/symfony_5.0.2-1.dsc

cd symfony-5.0.2/
sudo apt install php-symfony-event-dispatcher-contracts=1.1.10-2

>     DEB_BUILD_OPTIONS=nocheck debuild

Ugh, you'll anyway run into a lot of dependency resolution problems
here. Simply skip that via:
DEB_BUILD_OPTIONS=nocheck debuild -d

>     # 2a.  Get basic php-symfony bits in place
>     sudo dpkg -i ../php-symfony-security-core_5.0.2-1_all.deb \
>                  ../php-symfony-console_5.0.2-1_all.deb \
>                  ../php-symfony-css-selector_5.0.2-1_all.deb \
>                  ../php-symfony-mime_5.0.2-1_all.deb \
>                  ../php-symfony-intl_5.0.2-1_all.deb \
>                  ../php-symfony-yaml_5.0.2-1_all.deb \
>                  ../php-symfony-http-foundation_5.0.2-1_all.deb \
>                  ../php-symfony-phpunit-bridge_5.0.2-1_all.deb
>     sudo dpkg -i ../php-symfony-event-dispatcher_5.0.2-1_all.deb

Bah, you'll run into dependency problems; simply run:
sudo apt --fix-broken install
This will upgrade only 1 of the php-symfony-cache's deb
(php-symfony-event-dispatcher-contracts) to 2.4.0-1ubuntu2 (in
-proposed).

>     # 2b.  Install the symfony kernel
>     sudo apt-get install php-psr-log
>     sudo dpkg -i ../php-symfony-error-handler_5.0.2-1_all.deb \
>                  ../php-symfony-var-dumper_5.0.2-1_all.deb \
>                  ../php-symfony-http-kernel_5.0.2-1_all.deb
>
>     # 2c.  Install symfony cache
>     sudo dpkg -i ../php-symfony-var-exporter_5.0.2-1_all.deb \
>                  ../php-symfony-cache_5.0.2-1_all.deb
>
>     # 2d.  Install the symfony framework bundle
>     sudo apt-get install php-psr-container=1.0.0-2 \
>                          php-psr-cache=1.0.1-2 \
>                          php-symfony-service-contracts=1.1.10-2
>     sudo dpkg -i ../php-symfony-config_5.0.2-1_all.deb \
>                  ../php-symfony-dependency-injection_5.0.2-1_all.deb \
>                  ../php-symfony-filesystem_5.0.2-1_all.deb \
>                  ../php-symfony-finder_5.0.2-1_all.deb \
>                  ../php-symfony-routing_5.0.2-1_all.deb \
>                  ../php-symfony-framework-bundle_5.0.2-1_all.deb
>
>     # 2e.  Install php-twig's prereq's
>     sudo apt-get install php-twig=2.14.3-1
>     sudo dpkg -i ../php-symfony-twig-bundle_5.0.2-1_all.deb

Also needs its sister deb, ../php-symfony-twig-bridge_5.0.2-1_all.deb.
They go together.

>   - Step 3: Interim php-twig
>     (Has already been uploaded to -proposed with needed changes, just needs rebuilt)
>     apt-get source php-twig

Was lazy to enable deb-src URIs in sources.list so:
dget -x https://launchpad.net/ubuntu/+archive/primary/+sourcefiles/php-twig/3.3.2-1ubuntu1/php-twig_3.3.2-1ubuntu1.dsc

>     cd php-twig-3.3.2
>     sudo apt-get install php-league-commonmark \
>                  php-league-html-to-markdown \
>                  php-lorenzo-pinky php-parsedown \
>                  php-tijsverkoyen-css-to-inline-styles

sudo apt build-dep .

>     debuild
>     sudo dpkg -i ../php-twig_3.3.2-1ubuntu1_all.deb \
>                  ../php-twig-inky-extra_3.3.2-1ubuntu1_all.deb \
>                  ../php-twig-markdown-extra_3.3.2-1ubuntu1_all.deb \
>                  ../php-twig-cssinliner-extra_3.3.2-1ubuntu1_all.deb
>
>   - Step 4: Interim php-doctrine-persistence
>     dget -x https://launchpad.net/ubuntu/+archive/primary/+sourcefiles/php-doctrine-persistence/1.3.8-1/php-doctrine-persistence_1.3.8-1.dsc
>     cd php-doctrine-persistence-1.3.8/
>     sudo apt-get install php-doctrine-reflection

sudo apt build-dep .

>     DEB_BUILD_OPTIONS=nocheck debuild
>     sudo dpkg -i ../php-doctrine-persistence_1.3.8-1_all.deb
>
>
> ################################
> ### HERE BELOW BE YE DRAGONS ###
> ################################

Fair warning, I'll stop here for this mail :)


- u



More information about the ubuntu-server mailing list