The code has several syntax errors, but not related to the type definition as such.
The part to be corrected:
Code:
package type_def_pack is
constant s :integer range 1 to 5 := 1; -- originally wrong constant syntax. The range specification is meaningless, but doesn't actually hurt.
constant line_width :integer range 0 to 31 := 8; -- dito
type wire is array (0 to 2**s -1) of std_logic_vector(line_width-1 downto 0);
end package;
-- the below library specification is required for the entity
library IEEE;
use IEEE.std_logic_1164.all;
use IEEE.std_logic_arith.all;
use IEEE.std_logic_unsigned.all;
library work;
use work.type_def_pack.all;
entity Generic_Mux is